Hopefully fix the two-sided case for the Rembrandt renderer. Shadows are not fixed yet.
This commit is contained in:
parent
5753b2ce99
commit
ddf0c576e9
3 changed files with 16 additions and 10 deletions
|
@ -165,7 +165,7 @@
|
||||||
<blend>false</blend>
|
<blend>false</blend>
|
||||||
<alpha-test>true</alpha-test>
|
<alpha-test>true</alpha-test>
|
||||||
<shade-model>smooth</shade-model>
|
<shade-model>smooth</shade-model>
|
||||||
<cull-face>back</cull-face>
|
<cull-face><use>cull-face</use></cull-face>
|
||||||
<render-bin>
|
<render-bin>
|
||||||
<bin-number>1</bin-number>
|
<bin-number>1</bin-number>
|
||||||
<bin-name>RenderBin</bin-name>
|
<bin-name>RenderBin</bin-name>
|
||||||
|
@ -183,6 +183,9 @@
|
||||||
<mode>modulate</mode>
|
<mode>modulate</mode>
|
||||||
</environment>
|
</environment>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
<vertex-program-two-side>
|
||||||
|
<use>vertex-program-two-side</use>
|
||||||
|
</vertex-program-two-side>
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/deferred-gbuffer.vert</vertex-shader>
|
<vertex-shader>Shaders/deferred-gbuffer.vert</vertex-shader>
|
||||||
<fragment-shader>Shaders/deferred-gbuffer.frag</fragment-shader>
|
<fragment-shader>Shaders/deferred-gbuffer.frag</fragment-shader>
|
||||||
|
|
|
@ -5,17 +5,18 @@
|
||||||
// attachment 2: specular.l | shininess | emission.l | unused
|
// attachment 2: specular.l | shininess | emission.l | unused
|
||||||
//
|
//
|
||||||
varying vec3 ecNormal;
|
varying vec3 ecNormal;
|
||||||
varying vec4 color;
|
varying float alpha;
|
||||||
uniform int materialID;
|
uniform int materialID;
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
void main() {
|
void main() {
|
||||||
float specular = dot( gl_FrontMaterial.specular.rgb, vec3( 0.3, 0.59, 0.11 ) );
|
|
||||||
float shininess = gl_FrontMaterial.shininess;
|
|
||||||
float emission = dot( gl_FrontLightModelProduct.sceneColor.rgb, vec3( 0.3, 0.59, 0.11 ) );
|
|
||||||
vec4 texel = texture2D(texture, gl_TexCoord[0].st);
|
vec4 texel = texture2D(texture, gl_TexCoord[0].st);
|
||||||
if (texel.a * color.a < 0.1)
|
if (texel.a * alpha < 0.1)
|
||||||
discard;
|
discard;
|
||||||
|
float specular = dot( gl_FrontMaterial.specular.rgb, vec3( 0.3, 0.59, 0.11 ) );
|
||||||
|
float shininess = gl_FrontMaterial.shininess;
|
||||||
|
float emission = dot( gl_FrontLightModelProduct.sceneColor.rgb, vec3( 0.3, 0.59, 0.11 ) );
|
||||||
|
ecNormal = (2.0 * gl_Color.a - 1.0) * ecNormal;
|
||||||
gl_FragData[0] = vec4( (ecNormal.xy + vec2(1.0,1.0)) * 0.5, 0.0, 1.0 );
|
gl_FragData[0] = vec4( (ecNormal.xy + vec2(1.0,1.0)) * 0.5, 0.0, 1.0 );
|
||||||
gl_FragData[1] = vec4( color.rgb * texel.rgb, float( materialID ) / 255.0 );
|
gl_FragData[1] = vec4( gl_Color.rgb * texel.rgb, float( materialID ) / 255.0 );
|
||||||
gl_FragData[2] = vec4( specular, shininess / 255.0, emission, 1.0 );
|
gl_FragData[2] = vec4( specular, shininess / 255.0, emission, 1.0 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
// attachment 2: specular.l | shininess | emission.l | unused
|
// attachment 2: specular.l | shininess | emission.l | unused
|
||||||
//
|
//
|
||||||
varying vec3 ecNormal;
|
varying vec3 ecNormal;
|
||||||
varying vec4 color;
|
varying float alpha;
|
||||||
void main() {
|
void main() {
|
||||||
ecNormal = gl_NormalMatrix * gl_Normal;
|
ecNormal = gl_NormalMatrix * gl_Normal;
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||||
color = gl_Color;
|
gl_FrontColor.rgb = gl_Color.rgb; gl_FrontColor.a = 1.0;
|
||||||
|
gl_BackColor.rgb = gl_Color.rgb; gl_BackColor.a = 0.0;
|
||||||
|
alpha = gl_Color.a;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue