1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 10:53:51 +00:00

Merge remote branch 'scrawl/shadersystem'

This commit is contained in:
Marc Zinnschlag 2012-08-11 15:06:04 +02:00
commit 5e33d49970
2 changed files with 10 additions and 7 deletions

View file

@ -116,8 +116,9 @@
shInput(float3, normalPassthrough) shInput(float3, normalPassthrough)
shInput(float3, objSpacePositionPassthrough) shInput(float3, objSpacePositionPassthrough)
shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour) shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour)
//shUniform(float, passIteration) @shAutoConstant(passIteration, pass_iteration_number) #if !HAS_VERTEXCOLOR
shUniform(float4, materialAmbient) @shAutoConstant(materialAmbient, surface_ambient_colour) shUniform(float4, materialAmbient) @shAutoConstant(materialAmbient, surface_ambient_colour)
#endif
shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour) shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour)
shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour) shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)
@shForeach(@shGlobalSettingString(num_lights)) @shForeach(@shGlobalSettingString(num_lights))
@ -178,8 +179,13 @@
float3 lightDir; float3 lightDir;
float3 diffuse = float3(0,0,0); float3 diffuse = float3(0,0,0);
float d; float d;
float3 ambient = materialAmbient.xyz * lightAmbient.xyz;
#if HAS_VERTEXCOLOR
// ambient vertex colour tracking, FFP behaviour
float3 ambient = colourPassthrough.xyz * lightAmbient.xyz;
#else
float3 ambient = materialAmbient.xyz * lightAmbient.xyz;
#endif
// shadows only for the first (directional) light // shadows only for the first (directional) light
#if SHADOWS #if SHADOWS
@ -238,10 +244,6 @@
@shEndForeach @shEndForeach
#if HAS_VERTEXCOLOR
ambient *= colourPassthrough.xyz;
#endif
shOutputColour(0).xyz *= (ambient + diffuse + materialEmissive.xyz); shOutputColour(0).xyz *= (ambient + diffuse + materialEmissive.xyz);
#endif #endif
@ -293,6 +295,7 @@
#if MRT #if MRT
shOutputColour(1) = float4(depthPassthrough / far,1,1,1); shOutputColour(1) = float4(depthPassthrough / far,1,1,1);
#endif #endif
} }
#endif #endif

View file

@ -1,5 +1,5 @@
#define FIXED_BIAS 0.005 #define FIXED_BIAS 0.0003
float depthShadowPCF (shTexture2D shadowMap, float4 shadowMapPos, float2 offset) float depthShadowPCF (shTexture2D shadowMap, float4 shadowMapPos, float2 offset)
{ {