mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-30 07:10:28 +02:00
Enhance shader material to show how to pass material values
Also document that gl_FrontMaterial is no longer supported in Irrlicht 1.9 (this has been the case for a few years, I just never noticed this was changed as I never even knew that was possible in the past...). Will keep it that way is it's definitely going in the right direction (getting rid of legacy support and going towards OpenGL core instead), git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6498 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -11,6 +11,7 @@ float4x4 mInvWorld; // Inverted world matrix
|
||||
float4x4 mTransWorld; // Transposed world matrix
|
||||
float3 mLightPos; // Light position (actually just camera-pos in this case)
|
||||
float4 mLightColor; // Light color
|
||||
float4 mEmissive; // Emissive material color
|
||||
|
||||
|
||||
// Vertex shader output structure
|
||||
@ -83,6 +84,7 @@ PS_OUTPUT pixelMain(float2 TexCoord : TEXCOORD0,
|
||||
// multiply with diffuse and do other senseless operations
|
||||
Output.RGBColor = Diffuse * col;
|
||||
Output.RGBColor *= 4.0;
|
||||
Output.RGBColor += mEmissive;
|
||||
|
||||
return Output;
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
|
||||
uniform sampler2D myTexture;
|
||||
uniform vec4 mEmissive;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0]));
|
||||
col *= gl_Color;
|
||||
gl_FragColor = col * 4.0;
|
||||
gl_FragColor += mEmissive;
|
||||
}
|
||||
|
Reference in New Issue
Block a user