FIRE-3661; add color uniform to previewV.glsl.

Nicky 2012-07-19 00:17:37 +02:00
parent 53136d0eae
commit d858030301
2 changed files with 15 additions and 3 deletions

View File

@ -35,6 +35,9 @@ ATTRIBUTE vec2 texcoord0;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
// <FS:ND> FIRE-3661; Uniform variable for color.
uniform vec4 color;
// </FS:ND>
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@ -50,8 +53,12 @@ void main()
calcAtmospherics(pos.xyz);
vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
vertex_color = color;
// <FS:ND> USe color passed by uniform instead of hardcoded value
// vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
// vertex_color = color;
vertex_color = calcLighting(pos.xyz, norm, color, vec4(0.));
// </FS:ND>
}

View File

@ -911,6 +911,11 @@ BOOL LLImagePreviewSculpted::render()
const F32 BRIGHTNESS = 0.9f;
gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS);
// <FS:ND> FIRE-3661; set color to 1/1/1/1, this is the value that was
// previously hard coded in previewV.glsl
gGL.diffuseColor4f( 1., 1., 1., 1. );
// </FS:ND>
mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
mVertexBuffer->draw(LLRender::TRIANGLES, num_indices, 0);