Added separate scribe function to evalGlobalLightingAlphaBlendedWithHaze to shorten shader C string

This commit is contained in:
Olivier Prat 2018-01-23 14:19:39 +01:00
parent 8985514a31
commit 24692f13fd
6 changed files with 11 additions and 5 deletions

View file

@ -203,6 +203,12 @@ vec3 evalGlobalLightingAlphaBlended(mat4 invViewMat, float shadowAttenuation, fl
return color; return color;
} }
<@endfunc@>
<@func declareEvalGlobalLightingAlphaBlendedWithHaze()@>
<$declareLightingAmbient(1, 1, 1)$>
<$declareLightingDirectional()$>
vec3 evalGlobalLightingAlphaBlendedWithHaze( vec3 evalGlobalLightingAlphaBlendedWithHaze(
mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal,

View file

@ -47,7 +47,7 @@ void main(void) {
<$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>; <$evalMaterialEmissive(emissiveTex, emissive, matKey, emissive)$>;
vec3 viewNormal; vec3 viewNormal;
<$tangentToViewSpaceLOD(_position, normalTex, _normal, _tangent, viewNormal)$> <$tangentToViewSpaceLOD(_position, normalTex, _normal, _tangent, viewNormal)$>
float scattering = getMaterialScattering(mat); float scattering = getMaterialScattering(mat);
<$evalMaterialScattering(scatteringTex, scattering, matKey, scattering)$>; <$evalMaterialScattering(scatteringTex, scattering, matKey, scattering)$>;

View file

@ -16,7 +16,7 @@
<@include DeferredGlobalLight.slh@> <@include DeferredGlobalLight.slh@>
<$declareEvalGlobalLightingAlphaBlended()$> <$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
<@include LightLocal.slh@> <@include LightLocal.slh@>

View file

@ -16,7 +16,7 @@
<@include DeferredGlobalLight.slh@> <@include DeferredGlobalLight.slh@>
<$declareEvalGlobalLightingAlphaBlended()$> <$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
<@include LightLocal.slh@> <@include LightLocal.slh@>

View file

@ -11,7 +11,7 @@
// //
<@include DeferredGlobalLight.slh@> <@include DeferredGlobalLight.slh@>
<$declareEvalGlobalLightingAlphaBlended()$> <$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
<@include graphics/Material.slh@> <@include graphics/Material.slh@>

View file

@ -16,7 +16,7 @@
<@include DeferredBufferWrite.slh@> <@include DeferredBufferWrite.slh@>
<@include DeferredGlobalLight.slh@> <@include DeferredGlobalLight.slh@>
<$declareEvalGlobalLightingAlphaBlended()$> <$declareEvalGlobalLightingAlphaBlendedWithHaze()$>
<@include gpu/Transform.slh@> <@include gpu/Transform.slh@>
<$declareStandardCameraTransform()$> <$declareStandardCameraTransform()$>