Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //== PROGRAM LINK STATUS = TRUE
- //== PROGRAM VALIDATE STATUS = TRUE
- //======================================================
- // Vertex Shader 25
- //======================================================
- //== SHADER COMPILE STATUS = TRUE
- #version 150
- #define PC
- float saturate( float v ) { return clamp( v, 0.0, 1.0 ); }
- vec2 saturate( vec2 v ) { return clamp( v, 0.0, 1.0 ); }
- vec3 saturate( vec3 v ) { return clamp( v, 0.0, 1.0 ); }
- vec4 saturate( vec4 v ) { return clamp( v, 0.0, 1.0 ); }
- vec4 tex2Dlod( sampler2D sampler, vec4 texcoord ) { return textureLod( sampler, texcoord.xy, texcoord.w ); }
- uniform vec4 _va_[16];
- float dot3 (vec3 a , vec3 b ) {return dot ( a , b ) ; }
- float dot3 (vec3 a , vec4 b ) {return dot ( a , b. xyz ) ; }
- float dot3 (vec4 a , vec3 b ) {return dot ( a. xyz , b ) ; }
- float dot3 (vec4 a , vec4 b ) {return dot ( a. xyz , b. xyz ) ; }
- float dot4 (vec4 a , vec4 b ) {return dot ( a , b ) ; }
- float dot4 (vec2 a , vec4 b ) {return dot ( vec4 ( a , 0 , 1 ) , b ) ; }
- uniform matrices_ubo {vec4 matrices [ 408 ] ; } ;
- in vec4 in_Position;
- in vec2 in_TexCoord;
- in vec4 in_Normal;
- in vec4 in_Tangent;
- in vec4 in_Color;
- in vec4 in_Color2;
- out vec4 gl_Position;
- out vec4 vofi_TexCoord0;
- out vec4 vofi_TexCoord1;
- out vec4 vofi_TexCoord2;
- out vec4 vofi_TexCoord3;
- out vec4 vofi_TexCoord4;
- out vec4 vofi_TexCoord5;
- out vec4 vofi_TexCoord6;
- out vec4 gl_FrontColor;
- void main() {
- vec4 vNormal = in_Normal * 2.0 - 1.0 ;
- vec4 vTangent = in_Tangent * 2.0 - 1.0 ;
- vec3 vBinormal = cross ( vNormal. xyz , vTangent. xyz ) * vTangent. w ;
- float w0 = in_Color2 . x ;
- float w1 = in_Color2 . y ;
- float w2 = in_Color2 . z ;
- float w3 = in_Color2 . w ;
- vec4 matX , matY , matZ ;
- float joint = in_Color . x * 255.1 * 3 ;
- matX = matrices [ int ( joint + 0 ) ] * w0 ;
- matY = matrices [ int ( joint + 1 ) ] * w0 ;
- matZ = matrices [ int ( joint + 2 ) ] * w0 ;
- joint = in_Color . y * 255.1 * 3 ;
- matX += matrices [ int ( joint + 0 ) ] * w1 ;
- matY += matrices [ int ( joint + 1 ) ] * w1 ;
- matZ += matrices [ int ( joint + 2 ) ] * w1 ;
- joint = in_Color . z * 255.1 * 3 ;
- matX += matrices [ int ( joint + 0 ) ] * w2 ;
- matY += matrices [ int ( joint + 1 ) ] * w2 ;
- matZ += matrices [ int ( joint + 2 ) ] * w2 ;
- joint = in_Color . w * 255.1 * 3 ;
- matX += matrices [ int ( joint + 0 ) ] * w3 ;
- matY += matrices [ int ( joint + 1 ) ] * w3 ;
- matZ += matrices [ int ( joint + 2 ) ] * w3 ;
- vec3 normal ;
- normal. x = dot3 ( matX , vNormal ) ;
- normal. y = dot3 ( matY , vNormal ) ;
- normal. z = dot3 ( matZ , vNormal ) ;
- normal = normalize ( normal ) ;
- vec3 tangent ;
- tangent. x = dot3 ( matX , vTangent ) ;
- tangent. y = dot3 ( matY , vTangent ) ;
- tangent. z = dot3 ( matZ , vTangent ) ;
- tangent = normalize ( tangent ) ;
- vec3 binormal ;
- binormal. x = dot3 ( matX , vBinormal ) ;
- binormal. y = dot3 ( matY , vBinormal ) ;
- binormal. z = dot3 ( matZ , vBinormal ) ;
- binormal = normalize ( binormal ) ;
- vec4 modelPosition ;
- modelPosition. x = dot4 ( matX , in_Position ) ;
- modelPosition. y = dot4 ( matY , in_Position ) ;
- modelPosition. z = dot4 ( matZ , in_Position ) ;
- modelPosition. w = 1.0 ;
- gl_Position . x = dot4 ( modelPosition , _va_[12 /* rpMVPmatrixX */] ) ;
- gl_Position . y = dot4 ( modelPosition , _va_[13 /* rpMVPmatrixY */] ) ;
- gl_Position . z = dot4 ( modelPosition , _va_[14 /* rpMVPmatrixZ */] ) ;
- gl_Position . w = dot4 ( modelPosition , _va_[15 /* rpMVPmatrixW */] ) ;
- vec4 defaultTexCoord = vec4 ( 0.0 , 0.5 , 0.0 , 1.0 ) ;
- vec4 toLight = _va_[0 /* rpLocalLightOrigin */] - modelPosition ;
- vofi_TexCoord0 . x = dot3 ( tangent , toLight ) ;
- vofi_TexCoord0 . y = dot3 ( binormal , toLight ) ;
- vofi_TexCoord0 . z = dot3 ( normal , toLight ) ;
- vofi_TexCoord0 . w = 1.0 ;
- vofi_TexCoord1 = defaultTexCoord ;
- vofi_TexCoord1 . x = dot4 ( in_TexCoord . xy , _va_[6 /* rpBumpMatrixS */] ) ;
- vofi_TexCoord1 . y = dot4 ( in_TexCoord . xy , _va_[7 /* rpBumpMatrixT */] ) ;
- vofi_TexCoord2 = defaultTexCoord ;
- vofi_TexCoord2 . x = dot4 ( modelPosition , _va_[5 /* rpLightFalloffS */] ) ;
- vofi_TexCoord3 . x = dot4 ( modelPosition , _va_[2 /* rpLightProjectionS */] ) ;
- vofi_TexCoord3 . y = dot4 ( modelPosition , _va_[3 /* rpLightProjectionT */] ) ;
- vofi_TexCoord3 . z = 0.0 ;
- vofi_TexCoord3 . w = dot4 ( modelPosition , _va_[4 /* rpLightProjectionQ */] ) ;
- vofi_TexCoord4 = defaultTexCoord ;
- vofi_TexCoord4 . x = dot4 ( in_TexCoord . xy , _va_[8 /* rpDiffuseMatrixS */] ) ;
- vofi_TexCoord4 . y = dot4 ( in_TexCoord . xy , _va_[9 /* rpDiffuseMatrixT */] ) ;
- vofi_TexCoord5 = defaultTexCoord ;
- vofi_TexCoord5 . x = dot4 ( in_TexCoord . xy , _va_[10 /* rpSpecularMatrixS */] ) ;
- vofi_TexCoord5 . y = dot4 ( in_TexCoord . xy , _va_[11 /* rpSpecularMatrixT */] ) ;
- toLight = normalize ( toLight ) ;
- vec4 toView = normalize ( _va_[1 /* rpLocalViewOrigin */] - modelPosition ) ;
- vec4 halfAngleVector = toLight + toView ;
- vofi_TexCoord6 . x = dot3 ( tangent , halfAngleVector ) ;
- vofi_TexCoord6 . y = dot3 ( binormal , halfAngleVector ) ;
- vofi_TexCoord6 . z = dot3 ( normal , halfAngleVector ) ;
- vofi_TexCoord6 . w = 1.0 ;
- gl_FrontColor = vec4 ( 1.0 , 1.0 , 1.0 , 1.0 ) ;
- }
- //======================================================
- // Fragment Shader 26
- //======================================================
- //== SHADER COMPILE STATUS = TRUE
- #version 150
- #define PC
- void clip( float v ) { if ( v < 0.0 ) { discard; } }
- void clip( vec2 v ) { if ( any( lessThan( v, vec2( 0.0 ) ) ) ) { discard; } }
- void clip( vec3 v ) { if ( any( lessThan( v, vec3( 0.0 ) ) ) ) { discard; } }
- void clip( vec4 v ) { if ( any( lessThan( v, vec4( 0.0 ) ) ) ) { discard; } }
- float saturate( float v ) { return clamp( v, 0.0, 1.0 ); }
- vec2 saturate( vec2 v ) { return clamp( v, 0.0, 1.0 ); }
- vec3 saturate( vec3 v ) { return clamp( v, 0.0, 1.0 ); }
- vec4 saturate( vec4 v ) { return clamp( v, 0.0, 1.0 ); }
- vec4 tex2D( sampler2D sampler, vec2 texcoord ) { return texture( sampler, texcoord.xy ); }
- vec4 tex2D( sampler2DShadow sampler, vec3 texcoord ) { return vec4( texture( sampler, texcoord.xyz ) ); }
- vec4 tex2D( sampler2D sampler, vec2 texcoord, vec2 dx, vec2 dy ) { return textureGrad( sampler, texcoord.xy, dx, dy ); }
- vec4 tex2D( sampler2DShadow sampler, vec3 texcoord, vec2 dx, vec2 dy ) { return vec4( textureGrad( sampler, texcoord.xyz, dx, dy ) ); }
- vec4 texCUBE( samplerCube sampler, vec3 texcoord ) { return texture( sampler, texcoord.xyz ); }
- vec4 texCUBE( samplerCubeShadow sampler, vec4 texcoord ) { return vec4( texture( sampler, texcoord.xyzw ) ); }
- vec4 tex1Dproj( sampler1D sampler, vec2 texcoord ) { return textureProj( sampler, texcoord ); }
- vec4 tex2Dproj( sampler2D sampler, vec3 texcoord ) { return textureProj( sampler, texcoord ); }
- vec4 tex3Dproj( sampler3D sampler, vec4 texcoord ) { return textureProj( sampler, texcoord ); }
- vec4 tex1Dbias( sampler1D sampler, vec4 texcoord ) { return texture( sampler, texcoord.x, texcoord.w ); }
- vec4 tex2Dbias( sampler2D sampler, vec4 texcoord ) { return texture( sampler, texcoord.xy, texcoord.w ); }
- vec4 tex3Dbias( sampler3D sampler, vec4 texcoord ) { return texture( sampler, texcoord.xyz, texcoord.w ); }
- vec4 texCUBEbias( samplerCube sampler, vec4 texcoord ) { return texture( sampler, texcoord.xyz, texcoord.w ); }
- vec4 tex1Dlod( sampler1D sampler, vec4 texcoord ) { return textureLod( sampler, texcoord.x, texcoord.w ); }
- vec4 tex2Dlod( sampler2D sampler, vec4 texcoord ) { return textureLod( sampler, texcoord.xy, texcoord.w ); }
- vec4 tex3Dlod( sampler3D sampler, vec4 texcoord ) { return textureLod( sampler, texcoord.xyz, texcoord.w ); }
- vec4 texCUBElod( samplerCube sampler, vec4 texcoord ) { return textureLod( sampler, texcoord.xyz, texcoord.w ); }
- uniform vec4 _fa_[2];
- float dot3 (vec3 a , vec3 b ) {return dot ( a , b ) ; }
- float dot3 (vec3 a , vec4 b ) {return dot ( a , b. xyz ) ; }
- float dot3 (vec4 a , vec3 b ) {return dot ( a. xyz , b ) ; }
- float dot3 (vec4 a , vec4 b ) {return dot ( a. xyz , b. xyz ) ; }
- float dot4 (vec4 a , vec4 b ) {return dot ( a , b ) ; }
- float dot4 (vec2 a , vec4 b ) {return dot ( vec4 ( a , 0 , 1 ) , b ) ; }
- const vec4 matrixCoCg1YtoRGB1X = vec4( 1.0, -1.0, 0.0, 1.0 );
- const vec4 matrixCoCg1YtoRGB1Y = vec4( 0.0, 1.0, -0.50196078, 1.0 );
- const vec4 matrixCoCg1YtoRGB1Z = vec4( -1.0, -1.0, 1.00392156, 1.0 );
- vec3 ConvertYCoCgToRGB (vec4 YCoCg ) {
- vec3 rgbColor ;
- YCoCg. z = ( YCoCg. z * 31.875 ) + 1.0 ;
- YCoCg. z = 1.0 / YCoCg. z ;
- YCoCg. xy *= YCoCg. z ;
- rgbColor. x = dot4 ( YCoCg , matrixCoCg1YtoRGB1X ) ;
- rgbColor. y = dot4 ( YCoCg , matrixCoCg1YtoRGB1Y ) ;
- rgbColor. z = dot4 ( YCoCg , matrixCoCg1YtoRGB1Z ) ;
- return rgbColor ;
- }
- vec4 idtex2Dproj (sampler2D samp , vec4 texCoords ) {return tex2Dproj ( samp , texCoords. xyw ) ; }
- uniform sampler2D samp0;
- uniform sampler2D samp1;
- uniform sampler2D samp2;
- uniform sampler2D samp3;
- uniform sampler2D samp4;
- in vec4 gl_FragCoord;
- in vec4 vofi_TexCoord0;
- in vec4 vofi_TexCoord1;
- in vec4 vofi_TexCoord2;
- in vec4 vofi_TexCoord3;
- in vec4 vofi_TexCoord4;
- in vec4 vofi_TexCoord5;
- in vec4 vofi_TexCoord6;
- in vec4 gl_Color;
- out vec4 gl_FragColor;
- void main() {
- vec4 bumpMap = tex2D ( samp0 , vofi_TexCoord1 . xy ) ;
- vec4 lightFalloff = idtex2Dproj ( samp1 , vofi_TexCoord2 ) ;
- vec4 lightProj = idtex2Dproj ( samp2 , vofi_TexCoord3 ) ;
- vec4 YCoCG = tex2D ( samp3 , vofi_TexCoord4 . xy ) ;
- vec4 specMap = tex2D ( samp4 , vofi_TexCoord5 . xy ) ;
- vec3 lightVector = normalize ( vofi_TexCoord0 . xyz ) ;
- vec3 diffuseMap = ConvertYCoCgToRGB ( YCoCG ) ;
- vec3 localNormal ;
- localNormal. xy = bumpMap. wy - 0.5 ;
- localNormal. z = sqrt ( abs ( dot ( localNormal. xy , localNormal. xy ) - 0.25 ) ) ;
- localNormal = normalize ( localNormal ) ;
- float specularPower = 10.0 ;
- float hDotN = dot3 ( normalize ( vofi_TexCoord6 . xyz ) , localNormal ) ;
- vec3 specularContribution = vec3 ( pow ( hDotN , specularPower ) ) ;
- vec3 diffuseColor = diffuseMap * _fa_[0 /* rpDiffuseModifier */] . xyz ;
- vec3 specularColor = specMap. xyz * specularContribution * _fa_[1 /* rpSpecularModifier */] . xyz ;
- vec3 lightColor = dot3 ( lightVector , localNormal ) * lightProj. xyz * lightFalloff. xyz ;
- gl_FragColor . xyz = ( diffuseColor + specularColor ) * lightColor * gl_Color . xyz ;
- gl_FragColor . w = 1.0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment