|
|
@@ -1,203 +0,0 @@
|
|
|
-<!--
|
|
|
-Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
|
|
|
-All rights reserved.
|
|
|
-Code licensed under the BSD License.
|
|
|
-http://www.anki3d.org/LICENSE
|
|
|
--->
|
|
|
-<shaderProgram>
|
|
|
- <mutators>
|
|
|
- <mutator name="INSTANCE_COUNT" values="1 2 4 8 16 32 64" instanced="1"/>
|
|
|
- <mutator name="LOD" values="0 1 2"/>
|
|
|
- <mutator name="PASS" values="0 1 2"/>
|
|
|
- <mutator name="DIFFUSE_TEX" values="0 1"/>
|
|
|
- <mutator name="SPECULAR_TEX" values="0 1"/>
|
|
|
- <mutator name="ROUGHNESS_TEX" values="0 1"/>
|
|
|
- <mutator name="METAL_TEX" values="0 1"/>
|
|
|
- <mutator name="NORMAL_TEX" values="0 1"/>
|
|
|
- <mutator name="PARALLAX" values="0 1"/>
|
|
|
- <mutator name="EMISSIVE_TEX" values="0 1"/>
|
|
|
- <mutator name="BONES" values="0 1"/>
|
|
|
- </mutators>
|
|
|
-
|
|
|
- <shaders>
|
|
|
- <shader type="vert">
|
|
|
- <inputs>
|
|
|
- <input name="mvp" type="Mat4" instanced="1"/>
|
|
|
- <input name="rotationMat" type="Mat3" instanced="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="modelViewMat" type="Mat4" instanced="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- <mutator name="PARALLAX" values="1"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- </inputs>
|
|
|
-
|
|
|
- <source><![CDATA[
|
|
|
-#include <shaders/GBufferCommonVert.glsl>
|
|
|
-
|
|
|
-void main()
|
|
|
-{
|
|
|
-#if BONES
|
|
|
- skinning();
|
|
|
-#endif
|
|
|
-
|
|
|
-#if PASS == PASS_GB_FS
|
|
|
- positionUvNormalTangent(mvp, rotationMat);
|
|
|
-
|
|
|
-# if PARALLAX
|
|
|
- parallax(modelViewMat);
|
|
|
-# endif
|
|
|
-#else
|
|
|
- gl_Position = mvp * Vec4(g_position, 1.0);
|
|
|
-#endif
|
|
|
-}
|
|
|
- ]]>
|
|
|
- </source>
|
|
|
- </shader>
|
|
|
-
|
|
|
- <shader type="frag">
|
|
|
- <inputs>
|
|
|
- <!-- Consts -->
|
|
|
- <input name="diffColor" type="Vec3" const="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="DIFFUSE_TEX" values="0"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="specColor" type="Vec3" const="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="SPECULAR_TEX" values="0"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="roughness" type="F32" const="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="ROUGHNESS_TEX" values="0"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="metallic" type="F32" const="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="METAL_TEX" values="0"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="emission" type="Vec3" const="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="EMISSIVE_TEX" values="0"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="heightMapScale" type="F32" const="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="PARALLAX" values="1"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- <mutator name="LOD" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="subsurface" type="F32" const="1">
|
|
|
- <mutators>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
-
|
|
|
- <!-- Textures -->
|
|
|
- <input name="diffTex" type="sampler2D">
|
|
|
- <mutators>
|
|
|
- <mutator name="DIFFUSE_TEX" values="1"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="specTex" type="sampler2D">
|
|
|
- <mutators>
|
|
|
- <mutator name="SPECULAR_TEX" values="1"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="roughnessTex" type="sampler2D">
|
|
|
- <mutators>
|
|
|
- <mutator name="ROUGHNESS_TEX" values="1"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="metalTex" type="sampler2D">
|
|
|
- <mutators>
|
|
|
- <mutator name="METAL_TEX" values="1"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="normalTex" type="sampler2D">
|
|
|
- <mutators>
|
|
|
- <mutator name="NORMAL_TEX" values="1"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- <mutator name="LOD" values="0 1"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="heightTex" type="sampler2D">
|
|
|
- <mutators>
|
|
|
- <mutator name="PARALLAX" values="1"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- <mutator name="LOD" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- <input name="emissiveTex" type="sampler2D">
|
|
|
- <mutators>
|
|
|
- <mutator name="EMISSIVE_TEX" values="1"/>
|
|
|
- <mutator name="PASS" values="0"/>
|
|
|
- </mutators>
|
|
|
- </input>
|
|
|
- </inputs>
|
|
|
-
|
|
|
- <source><![CDATA[
|
|
|
-#include <shaders/GBufferCommonFrag.glsl>
|
|
|
-
|
|
|
-void main()
|
|
|
-{
|
|
|
-#if PASS == PASS_GB_FS
|
|
|
-# if heightTex_DEFINED
|
|
|
- Vec2 uv = computeTextureCoordParallax(heightTex, in_uv, heightMapScale);
|
|
|
-# else
|
|
|
- Vec2 uv = in_uv;
|
|
|
-# endif
|
|
|
-
|
|
|
-# if diffTex_DEFINED
|
|
|
- Vec3 diffColor = texture(diffTex, uv).rgb;
|
|
|
-# endif
|
|
|
-
|
|
|
-# if specTex_DEFINED
|
|
|
- Vec3 specColor = texture(specTex, uv).rgb;
|
|
|
-# endif
|
|
|
-
|
|
|
-# if roughnessTex_DEFINED
|
|
|
- F32 roughness = texture(roughnessTex, uv).r;
|
|
|
-# endif
|
|
|
-
|
|
|
-# if metalTex_DEFINED
|
|
|
- F32 metallic = texture(metalTex, uv).r;
|
|
|
-# endif
|
|
|
-
|
|
|
-# if normalTex_DEFINED
|
|
|
- Vec3 normal = readNormalFromTexture(normalTex, uv);
|
|
|
-# else
|
|
|
- Vec3 normal = normalize(in_normal);
|
|
|
-# endif
|
|
|
-
|
|
|
-# if emissiveTex_DEFINED
|
|
|
- Vec3 emission = texture(emissiveTex, uv).rgb;
|
|
|
-# endif
|
|
|
-
|
|
|
- writeRts(diffColor, normal, specColor, roughness, subsurface, emission, metallic);
|
|
|
-#elif PASS == PASS_EZ
|
|
|
- out_msRt0 = Vec4(0.0);
|
|
|
- out_msRt1 = Vec4(0.0);
|
|
|
- out_msRt2 = Vec4(0.0);
|
|
|
-#endif
|
|
|
-}
|
|
|
- ]]></source>
|
|
|
- </shader>
|
|
|
- </shaders>
|
|
|
-</shaderProgram>
|