Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How do I create custom shaders?

I have some basic shader code going for rendering a simple 2D shape, but how would I go about tweaking and building on the code to make my own custom object, say a piece of wood?

Update:

By the way, this is being done in the GLSL coding language

1 Answer

Relevance
  • 7 years ago
    Favorite Answer

    That's a very interesting question... The best answer I can give is that you should buy a book. Programming shaders from scratch requires a certain level of math knowledge which I know nothing of your background. (Linear algebra mostly). I recommend a book because, well, your question is a broad question, and a book is about the quickest/best answer a person could give. I learned from this book: http://www.amazon.com/OpenGL-Shading-Language-3rd-... which by the way is still completely relevant, But there is probably something newer out there like http://www.amazon.com/OpenGL-4-0-Shading-Language-...

    I guess though, to answer your question, you're going to want to look into creating a bump map fragment shader which uses textures from the gl environment. Oh and, one more thing... usually there is multiple ways to accomplish a task in graphics because graphics are a hack to fool the user, there is no limit except your imagination.

    Good luck to you, shaders are a lot of fun and represent the pinnacle of graphics :)

    OK, im back again, I just remember that you can also grab a copy of RenderMonkey

    http://developer.amd.com/resources/archive/archive...

    This will help you create shaders outside of your programming environment and it also has code examples you can rip of learn from or both. I think that's all for now.

Still have questions? Get your answers by asking now.