Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //*****************************************************************************
- // Torque -- GLSL procedural shader
- //*****************************************************************************
- #include "shaders/common/gl/hlslCompat.glsl"
- // Dependencies:
- #include "shaders/common/gl/imposter.glsl"
- #include "shaders/common/gl/lighting.glsl"
- //------------------------------------------------------------------------------
- // Autogenerated 'Light Buffer Conditioner [RGB]' Uncondition Method
- //------------------------------------------------------------------------------
- void autogenUncondition_bde4cbab(in vec4 bufferSample, out vec3 lightColor, out float NL_att, out float specular)
- {
- lightColor = bufferSample.rgb;
- NL_att = dot(bufferSample.rgb, float3(0.3576, 0.7152, 0.1192));
- specular = bufferSample.a;
- }
- #include "shaders/common/gl/torque.glsl"
- // Features:
- // Imposter Vert
- // Vert Position
- // Base Texture
- // Alpha Test
- // Bumpmap [Deferred]
- // Deferred RT Lighting
- // Visibility
- // HDR Output
- // DXTnm
- struct VertexData
- {
- vec4 position;
- vec2 tcImposterParams;
- vec3 tcImposterUpVec;
- vec3 tcImposterRightVec;
- } IN;
- in vec4 vPosition;
- #define IN_position IN.position
- in vec2 vTexCoord0;
- #define IN_tcImposterParams IN.tcImposterParams
- in vec3 vTexCoord1;
- #define IN_tcImposterUpVec IN.tcImposterUpVec
- in vec3 vTexCoord2;
- #define IN_tcImposterRightVec IN.tcImposterRightVec
- out float _TEXCOORD0_;
- out vec2 _TEXCOORD1_;
- out vec4 _TEXCOORD2_;
- out vec4 _TEXCOORD3_;
- // Struct defines
- #define OUT_imposterFade _TEXCOORD0_
- #define OUT_out_texCoord _TEXCOORD1_
- #define OUT_screenspacePos _TEXCOORD2_
- #define OUT_outVpos _TEXCOORD3_
- //-----------------------------------------------------------------------------
- // Main
- //-----------------------------------------------------------------------------
- uniform vec4 imposterLimits ;
- uniform vec4 imposterUVs [64];
- uniform vec3 eyePosWorld ;
- uniform float4x4 modelview ;
- void main()
- {
- //-------------------------
- IN.position = vPosition;
- IN.tcImposterParams = vTexCoord0;
- IN.tcImposterUpVec = vTexCoord1;
- IN.tcImposterRightVec = vTexCoord2;
- //-------------------------
- // Imposter Vert
- vec3 inPosition;
- vec2 texCoord;
- float3x3 worldToTangent;
- OUT_imposterFade = IN_tcImposterParams.y;
- imposter_v( IN_position.xyz, int(IN_position.w), IN_tcImposterParams.x * length(IN_tcImposterRightVec), normalize(IN_tcImposterUpVec), normalize(IN_tcImposterRightVec), int(imposterLimits.y), int(imposterLimits.x), imposterLimits.z, bool(imposterLimits.w), eyePosWorld, imposterUVs, inPosition, texCoord, worldToTangent );
- vec3 wsPosition = inPosition.xyz;
- float3x3 viewToTangent = worldToTangent;
- // Vert Position
- gl_Position = tMul(modelview, float4(inPosition.xyz,1));
- // Base Texture
- OUT_out_texCoord = vec2(texCoord);
- // Alpha Test
- // Bumpmap [Deferred]
- // Deferred RT Lighting
- OUT_screenspacePos = gl_Position;
- // Visibility
- OUT_outVpos = gl_Position;
- // HDR Output
- // DXTnm
- gl_Position.y *= -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement