Add specular mapping (uses alpha channel of diffuse texture)

actorid
scrawl 11 years ago
parent 147bc447a5
commit 5f1878eb54

@ -350,7 +350,8 @@
float depthPassthrough = objSpacePositionPassthrough.w; float depthPassthrough = objSpacePositionPassthrough.w;
#endif #endif
shOutputColour(0) = shSample(diffuseMap, UV.xy); float4 diffuse = shSample(diffuseMap, UV.xy);
shOutputColour(0) = diffuse;
#if DETAIL_MAP #if DETAIL_MAP
#if @shPropertyString(detailMapUVSet) #if @shPropertyString(detailMapUVSet)
@ -483,7 +484,7 @@
float3 halfVec = normalize (light0Dir + eyeDir); float3 halfVec = normalize (light0Dir + eyeDir);
float3 specular = pow(max(dot(normal, halfVec), 0), matShininess) * lightSpec0 * matSpec; float3 specular = pow(max(dot(normal, halfVec), 0), matShininess) * lightSpec0 * matSpec;
shOutputColour(0).xyz += specular * shadow; shOutputColour(0).xyz += specular * shadow * diffuse.a;
#endif #endif
#if FOG #if FOG

Loading…
Cancel
Save