Rekindled Phoenix Posted February 28, 2012 Share Posted February 28, 2012 I can code all day, but shaders are honestly a little daunting. I'm wondering if anyone knows of some example shader code that would help me accomplish my goal. Similar to the caustics water shader, I want to apply a texture to a model depending on the angle of the verticies. Does anyone have tutorials or would be able to volunteer for this? Quote Link to comment Share on other sites More sharing options...
LordHippo Posted February 28, 2012 Share Posted February 28, 2012 Do you mean the global angle? So if the object turns the textures are changed? Or local angle of the vertices? Quote Ali Salehi | Programmer Intel Core i3 2100 @ 3.0GHz | GeForce GTS 450 | 4GB DDR3 RAM | Windows 7 Ultimate x64 LE 2.50 | Visual Studio 2010 | RenderMonkey 1.82 | gDEBugger 5.8 | FX Composer 2.5 | UU3D 3 | xNormal 3.17 Link to comment Share on other sites More sharing options...
Rekindled Phoenix Posted February 29, 2012 Author Share Posted February 29, 2012 Global angle. Something similar to the snow shader in most modern game engines, but with multiple textures. Quote Link to comment Share on other sites More sharing options...
LordHippo Posted February 29, 2012 Share Posted February 29, 2012 You can calculate global normal in the "mesh.frag" like this: vec3 g_nml = normal * gl_NormalMatrix; Then you can combine textures based on this global normal. Quote Ali Salehi | Programmer Intel Core i3 2100 @ 3.0GHz | GeForce GTS 450 | 4GB DDR3 RAM | Windows 7 Ultimate x64 LE 2.50 | Visual Studio 2010 | RenderMonkey 1.82 | gDEBugger 5.8 | FX Composer 2.5 | UU3D 3 | xNormal 3.17 Link to comment Share on other sites More sharing options...
Rekindled Phoenix Posted March 1, 2012 Author Share Posted March 1, 2012 Awesome! I appreciate your help, but I wouldn't even know where to start when it comes to shader programming... or combining the texture blend alphas Do you know of an editor / tutorials /examples that could help me accomplish this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.