Commit 0ed2143e authored by Teemu Tamminen's avatar Teemu Tamminen

Added Island shader example

parent fd0d5c70
<?xml version='1.0' encoding='utf-8'?>
<application xmlns="http://qt.io/qt3dstudio/uia">
<assets initial="3d_presentation">
<presentation id="3d_presentation" src="presentations/3d_presentation.uip"/>
<dataInput metadata="" name="caustics" type="Float"/>
<dataInput metadata="" name="glasslightx" type="Ranged Number" min="-1000" max="1000"/>
<dataInput metadata="" name="lightx" type="Float"/>
<dataInput metadata="" name="time" type="Float"/>
<dataInput metadata="" name="windpower" type="Float"/>
<presentation id="LightProbe" src="presentations/LightProbe.uip"/>
</assets>
</application>
<?xml version="1.0" encoding="UTF-8" ?>
<Effect>
<MetaData>
<Property name="GammaValue" formalName="Gamma" default="2.2" min="0.1" max="4"/>
<Property name="Exposure" min="-9" max="9" default="0"/>
<Property name="BloomThreshold" formalName="Bloom Threshold" description="Objects brighter than this will\ngenerate a bloom" default="1.0" />
<Property name="BlurFalloff" formalName="Bloom Falloff" description="Size of the bloom. Smaller\nnumber means larger bloom." default="0" min="0" max="10"/>
<Property name="TonemappingLerp" formalName="Effect Amount" description="Adjust between no change and\nfull effect." default="1" min="0" max="1" hidden="True"/>
<!--
<Property name="Key" formalName="Luminance Key" min="0" max="1" default="0.04"/>
<Property name="expLum" formalName="Exposure Luminance" default="2.0"/>
<Property name="TonemappingLod" formalName="Tonemapping adaptation rate" default="10" min="0" max="20"/>
-->
<Property name="ChannelThreshold" formalName="Channel Threshold" hidden="True" description="Channel threshold" default="1.0" />
<Property name="PoissonRotation" hidden="True" default="0"/>
<Property name="PoissonDistance" hidden="True" default="4"/>
<Property name="Downsample2" filter="linear" clamp="clamp" type="Texture" />
<Property name="Downsample4" filter="linear" clamp="clamp" type="Texture" />
</MetaData>
<Shaders>
<Shared>
#include "blur.glsllib"
#include "luminance.glsllib"
float get_blur_falloff() { return exp2( -BlurFalloff ); }
float get_exposure() { return exp2( Exposure ); }
</Shared>
<Shader name="LUMINOSITY">
<VertexShader>
vec2 ToRotatedPoissonTexCoord( vec3 poisson, vec2 inputTex, vec2 inc, mat2 rotation )
{
vec2 rotatedPoisson = rotation * vec2( poisson.xy );
return vec2( inputTex.x + rotatedPoisson.x * inc.x, inputTex.y + rotatedPoisson.y * inc.y );
}
void SetupPoissonBlurCoordsRotation(float inBlurAmount, vec2 inTexInfo, float inRotationRadians )
{
float incX = inBlurAmount / inTexInfo.x;
float incY = inBlurAmount / inTexInfo.y;
float rotCos = cos( inRotationRadians );
float rotSin = sin( inRotationRadians );
mat2 rotMatrix = mat2( rotCos, rotSin, -rotSin, rotCos );
vec2 incVec = vec2( incX, incY );
TexCoord0 = ToRotatedPoissonTexCoord( poisson0, TexCoord, incVec, rotMatrix );
TexCoord1 = ToRotatedPoissonTexCoord( poisson1, TexCoord, incVec, rotMatrix );
TexCoord2 = ToRotatedPoissonTexCoord( poisson2, TexCoord, incVec, rotMatrix );
TexCoord3 = ToRotatedPoissonTexCoord( poisson3, TexCoord, incVec, rotMatrix );
TexCoord4 = ToRotatedPoissonTexCoord( poisson4, TexCoord, incVec, rotMatrix );
TexCoord5 = ToRotatedPoissonTexCoord( poisson5, TexCoord, incVec, rotMatrix );
TexCoord6 = ToRotatedPoissonTexCoord( poisson6, TexCoord, incVec, rotMatrix );
TexCoord7 = ToRotatedPoissonTexCoord( poisson7, TexCoord, incVec, rotMatrix );
}
// No op
void vert ()
{
SetupPoissonBlurCoordsRotation( 5.0 * get_blur_falloff(), Texture0Info.xy, 0.0);
}
</VertexShader>
<FragmentShader>
float cutoff( float color )
{
return color >= BloomThreshold ? color : 0.0;
}
vec4 cutoffColor( sampler2D inSampler, vec2 texCoord )
{
vec4 color = GetTextureValue(inSampler, texCoord, 1.0);
vec3 exposed_color = color.xyz * get_exposure();
vec3 cutoff_color = vec3( cutoff( color.x ), cutoff( color.y ), cutoff( color.z ) );
float pixelMult = dot( cutoff_color, cutoff_color ) > 0.0 ? 1.0 : 0.0;
return vec4( exposed_color.xyz, color.a ) * pixelMult;
}
vec4 PoissonBlur(sampler2D inSampler )
{
//flatten out the poisson for this step, we really just want to smear.
float mult0 = 1.0;
float mult1 = mult0;
float mult2 = mult0;
float mult3 = mult2;
float mult4 = mult2;
float mult5 = mult2;
float mult6 = mult2;
float mult7 = mult2;
float multTotal = mult0 + mult1 + mult2 + mult3 + mult4 + mult5 + mult6 + mult7;
float multMultiplier = ( multTotal > 0.0 ? 1.0 / multTotal : 0.0 );
vec4 outColor = cutoffColor( inSampler, TexCoord0 ) * (mult0 * multMultiplier);
outColor += cutoffColor( inSampler, TexCoord1 ) * (mult1 * multMultiplier);
outColor += cutoffColor( inSampler, TexCoord2 ) * (mult2 * multMultiplier);
outColor += cutoffColor( inSampler, TexCoord3 ) * (mult3 * multMultiplier);
outColor += cutoffColor( inSampler, TexCoord4 ) * (mult4 * multMultiplier);
outColor += cutoffColor( inSampler, TexCoord5 ) * (mult5 * multMultiplier);
outColor += cutoffColor( inSampler, TexCoord6 ) * (mult6 * multMultiplier);
outColor += cutoffColor( inSampler, TexCoord7 ) * (mult7 * multMultiplier);
return outColor;
}
void frag() // Luminosity pass with exponential color channel decay based on the threshold above.
{
gl_FragColor = PoissonBlur( Texture0 );
}
</FragmentShader>
</Shader>
<Shader name="BLUR">
<VertexShader>
vec2 ToRotatedPoissonTexCoord( vec3 poisson, vec2 inputTex, vec2 inc, mat2 rotation )
{
vec2 rotatedPoisson = rotation * vec2( poisson.xy );
return vec2( inputTex.x + rotatedPoisson.x * inc.x, inputTex.y + rotatedPoisson.y * inc.y );
}
void SetupPoissonBlurCoordsRotation(float inBlurAmount, vec2 inTexInfo, float inRotationRadians )
{
float incX = inBlurAmount / inTexInfo.x;
float incY = inBlurAmount / inTexInfo.y;
float rotCos = cos( inRotationRadians );
float rotSin = sin( inRotationRadians );
mat2 rotMatrix = mat2( rotCos, rotSin, -rotSin, rotCos );
vec2 incVec = vec2( incX, incY );
TexCoord0 = ToRotatedPoissonTexCoord( poisson0, TexCoord, incVec, rotMatrix );
TexCoord1 = ToRotatedPoissonTexCoord( poisson1, TexCoord, incVec, rotMatrix );
TexCoord2 = ToRotatedPoissonTexCoord( poisson2, TexCoord, incVec, rotMatrix );
TexCoord3 = ToRotatedPoissonTexCoord( poisson3, TexCoord, incVec, rotMatrix );
TexCoord4 = ToRotatedPoissonTexCoord( poisson4, TexCoord, incVec, rotMatrix );
TexCoord5 = ToRotatedPoissonTexCoord( poisson5, TexCoord, incVec, rotMatrix );
TexCoord6 = ToRotatedPoissonTexCoord( poisson6, TexCoord, incVec, rotMatrix );
TexCoord7 = ToRotatedPoissonTexCoord( poisson7, TexCoord, incVec, rotMatrix );
}
void vert ()
{
SetupPoissonBlurCoordsRotation( PoissonDistance, Texture0Info.xy, PoissonRotation);
}
</VertexShader>
<FragmentShader>
vec4 PoissonBlur(sampler2D inSampler )
{
float mult0 = (1.0 - poisson0.z);
float mult1 = (1.0 - poisson1.z);
float mult2 = (1.0 - poisson2.z);
float mult3 = (1.0 - poisson3.z);
float mult4 = (1.0 - poisson4.z);
float mult5 = (1.0 - poisson5.z);
float mult6 = (1.0 - poisson6.z);
float mult7 = (1.0 - poisson7.z);
float multTotal = mult0 + mult1 + mult2 + mult3 + mult4 + mult5 + mult6 + mult7;
float multMultiplier = ( multTotal > 0.0 ? 1.0 / multTotal : 0.0 ) * get_blur_falloff();
vec4 outColor = GetTextureValue( inSampler, TexCoord0, 1.0 ) * (mult0 * multMultiplier);
outColor += GetTextureValue( inSampler, TexCoord1, 1.0 ) * (mult1 * multMultiplier);
outColor += GetTextureValue( inSampler, TexCoord2, 1.0 ) * (mult2 * multMultiplier);
outColor += GetTextureValue( inSampler, TexCoord3, 1.0 ) * (mult3 * multMultiplier);
outColor += GetTextureValue( inSampler, TexCoord4, 1.0 ) * (mult4 * multMultiplier);
outColor += GetTextureValue( inSampler, TexCoord5, 1.0 ) * (mult5 * multMultiplier);
outColor += GetTextureValue( inSampler, TexCoord6, 1.0 ) * (mult6 * multMultiplier);
outColor += GetTextureValue( inSampler, TexCoord7, 1.0 ) * (mult7 * multMultiplier);
return outColor;
}
void frag()
{
//Passing in 1.0 means the value will not get alpha-multiplied again
gl_FragColor = PoissonBlur( Texture0 );
}
</FragmentShader>
</Shader>
<Shader name="COMBINER">
<FragmentShader>
/*
float GetAdaptedLuminance( sampler2D inSampler )
{
vec3 col = textureLod( inSampler, TexCoord, TonemappingLod).rgb;
return luminance( col );
}
vec3 GetTonemappedReinhard( sampler2D inSampler, vec3 inSource, vec3 inBlurred )
{
// adapted luminance value
float adpLm = GetAdaptedLuminance( inSampler );
// luminance of current color
float curLm = luminance( inSource.rgb );
// relative luminance
float relLm = Key/adpLm;
// displayable value D
float D = (relLm * (1.0 + relLm/(expLum*expLum)) / (1.0 + relLm));
// tone map result
vec3 color = inBlurred.xyz * relLm;
//vec3 gamaColor = pow(color, vec3(1.0/2.2));
//return gamaColor;
return vec3(relLm, relLm, relLm );
}
vec3 GetTonemappedReinhardSimple( vec3 inSource, vec3 inBlurred )
{
vec3 texColor = inBlurred * 1.0; // Hardcoded Exposure Adjustment
texColor = texColor/(1.0 + texColor);
vec3 retColor = pow( texColor, vec3(1.0/2.2) );
return retColor;
}
*/
void frag()
{
vec4 sourceColor = texture2D_0(TexCoord);
vec4 summation = texture2D_Downsample2(TexCoord)
+ texture2D_Downsample4(TexCoord);
vec3 bloom_result = sourceColor.xyz * get_exposure() + summation.xyz;
//Threshold defines the white point for the image which shouldn't be adaptive.
vec3 thresholded = clamp( bloom_result.xyz, 0.0, ChannelThreshold ) / ChannelThreshold;
vec3 tonemapped = pow( thresholded, vec3( 1.0 / GammaValue ) );
vec3 final_color = mix( thresholded, tonemapped, TonemappingLerp );
float resultAlpha = max( summation.a, sourceColor.a );
gl_FragColor = vec4( final_color, resultAlpha );
/*
gl_FragColor = vec4( texture2D_Downsample2(TexCoord).xyz
, 1.0 );
*/
}
</FragmentShader>
</Shader>
<Shader name="Passthrough">
<VertexShader>
void vert ()
{
}
</VertexShader>
<FragmentShader>
void frag()
{
//Passing in 1.0 means the value will not get alpha-multiplied again
gl_FragColor = GetTextureValue( Texture0, TexCoord, 1.0 );
}
</FragmentShader>
</Shader>
</Shaders>
<Passes>
<Buffer name="luminosity_buffer2" format="source" filter="linear" wrap="clamp" size=".5" lifetime="scene"/>
<Buffer name="downsample_buffer2" format="source" filter="linear" wrap="clamp" size=".5" lifetime="scene"/>
<Buffer name="downsample_buffer4" format="source" filter="linear" wrap="clamp" size=".25" lifetime="scene"/>
<Pass shader="LUMINOSITY" input="[source]" output='downsample_buffer2' >
</Pass>
<Pass shader="LUMINOSITY" input="downsample_buffer2" output='luminosity_buffer2' >
</Pass>
<!--<Pass shader='Passthrough' input='luminosity_buffer2' />-->
<Pass shader="BLUR" input="luminosity_buffer2" output="downsample_buffer2">
<SetParam name="PoissonDistance" value="4"/>
<SetParam name="PoissonRotation" value="0"/>
</Pass>
<Pass shader="BLUR" input="luminosity_buffer2" output="downsample_buffer4">
<SetParam name="PoissonDistance" value="4"/>
<SetParam name="PoissonRotation" value="0.62831"/>
</Pass>
<Pass shader="COMBINER" input="[source]">
<BufferInput param="Downsample2" value="downsample_buffer2"/>
<BufferInput param="Downsample4" value="downsample_buffer4"/>
<RenderState name="Stencil" value="false"/>
</Pass>
</Passes>
</Effect>
<MaterialData version="1.0">
<Property name="lightx">1</Property>
<Property name="windpower">1</Property>
<Property name="colormap" type="Texture"><![CDATA[./maps/plantLeaf.png]]></Property>
<Property name="xoffset">0.2</Property>
<Property name="yoffset">0.2</Property>
<Property name="zoffset">0.2</Property>
<Property name="mask">0.2</Property>
<Property name="sourcepath"><![CDATA[./materials/treeLeaves.shader]]></Property>
<Property name="importid"></Property>
<Property name="importfile"></Property>
<Property name="type">CustomMaterial</Property>
<Property name="name"><![CDATA[materials/Bush]]></Property>
<Property name="path"><![CDATA[C:/Users/tetammin/Desktop/Island_ShaderExample/3d_presentation/materials/Bush.materialdef]]></Property>
</MaterialData>
\ No newline at end of file
<MaterialData version="1.0">
<Property name="uEnvironmentTexture" type="Texture"><![CDATA[./presentations/LightProbe]]></Property>
<Property name="uEnvironmentMappingEnabled">True</Property>
<Property name="uBakedShadowTexture"></Property>
<Property name="uShadowMappingEnabled">False</Property>
<Property name="uFresnelPower">5.9</Property>
<Property name="roughness">0.23</Property>
<Property name="reflectivity_amount">0.44</Property>
<Property name="glass_ior">1</Property>
<Property name="glass_color">1 1 1 1</Property>
<Property name="glass_bump" type="Texture"><![CDATA[./maps/WaterNormal.jpg]]></Property>
<Property name="glass_bfactor">9</Property>
<Property name="glass_binside">False</Property>
<Property name="blur_size">22.07</Property>
<Property name="randomGradient1D" type="Texture"><![CDATA[./maps/materials/randomGradient1D.png]]></Property>
<Property name="randomGradient2D" type="Texture"><![CDATA[./maps/materials/randomGradient2D.png]]></Property>
<Property name="randomGradient3D" type="Texture"><![CDATA[./maps/materials/randomGradient3D.png]]></Property>
<Property name="randomGradient4D" type="Texture"><![CDATA[./maps/materials/randomGradient4D.png]]></Property>
<Property name="refract_depth">12.8</Property>
<Property name="bumpCoords">1 1 1</Property>
<Property name="bumpScale">1.25</Property>
<Property name="bumpBands">1</Property>
<Property name="intLightPos">0.5 0</Property>
<Property name="intLightCol">0.9 0.9 0.9 1</Property>
<Property name="intLightBrt">0</Property>
<Property name="intLightRot">0</Property>
<Property name="intLightFall">2</Property>
<Property name="sourcepath"><![CDATA[./materials/thin_glass_frosted.shader]]></Property>
<Property name="importid"></Property>
<Property name="importfile"></Property>
<Property name="type">CustomMaterial</Property>
<Property name="name"><![CDATA[materials/Glass]]></Property>
<Property name="path"><![CDATA[C:/Users/tetammin/Desktop/Island_ShaderExample/3d_presentation/materials/Glass.materialdef]]></Property>
</MaterialData>
\ No newline at end of file
<MaterialData version="1.0">
<Property name="lightx">1</Property>
<Property name="windpower">1</Property>
<Property name="grass" type="Texture"><![CDATA[./maps/grass.jpg]]></Property>
<Property name="rock" type="Texture"><![CDATA[./maps/rock.jpg]]></Property>
<Property name="sand" type="Texture"><![CDATA[./maps/sand.jpg]]></Property>
<Property name="caustics" type="Texture"><![CDATA[./maps/TexturesCom_Animated_WaterCaustics.png]]></Property>
<Property name="value">1</Property>
<Property name="row">6</Property>
<Property name="column">6</Property>
<Property name="sourcepath"><![CDATA[./materials/groundBlending.shader]]></Property>
<Property name="importid"></Property>
<Property name="importfile"></Property>
<Property name="type">CustomMaterial</Property>
<Property name="name"><![CDATA[materials/Ground]]></Property>
<Property name="path"><![CDATA[C:/Users/tetammin/Desktop/Island_ShaderExample/3d_presentation/materials/Ground.materialdef]]></Property>
</MaterialData>
\ No newline at end of file
<MaterialData version="1.0">
<Property name="lightx">1</Property>
<Property name="spacemap" type="Texture"><![CDATA[./maps/stars.jpg]]></Property>
<Property name="skymap" type="Texture"><![CDATA[./maps/sky.jpg]]></Property>
<Property name="cloudmap"></Property>
<Property name="sourcepath"><![CDATA[./materials/skybox.shader]]></Property>
<Property name="importid"></Property>
<Property name="importfile"></Property>
<Property name="type">CustomMaterial</Property>
<Property name="name"><![CDATA[materials/Sky]]></Property>
<Property name="path"><![CDATA[C:/Users/tetammin/Desktop/Island_ShaderExample/3d_presentation/materials/Sky.materialdef]]></Property>
</MaterialData>
\ No newline at end of file
<MaterialData version="1.0">
<Property name="lightx">1</Property>
<Property name="texturemap" type="Texture"><![CDATA[./maps/rock.jpg]]></Property>
<Property name="sourcepath"><![CDATA[./materials/stones.shader]]></Property>
<Property name="importid"></Property>
<Property name="importfile"></Property>
<Property name="type">CustomMaterial</Property>
<Property name="name"><![CDATA[materials/Stones]]></Property>
<Property name="path"><![CDATA[C:/Users/tetammin/Desktop/Island_ShaderExample/3d_presentation/materials/Stones.materialdef]]></Property>
</MaterialData>
\ No newline at end of file
<MaterialData version="1.0">
<Property name="time">1</Property>
<Property name="lightx">1</Property>
<Property name="windpower">1</Property>
<Property name="waveheight">0.3</Property>
<Property name="bottomheight">-0.5</Property>
<Property name="diffusemap" type="Texture"><![CDATA[./maps/WaterDiffuse.jpg]]></Property>
<Property name="caustics" type="Texture"><![CDATA[./.]]></Property>
<Property name="value">1</Property>
<Property name="row">6</Property>
<Property name="column">6</Property>
<Property name="foammap" type="Texture"><![CDATA[./.]]></Property>
<Property name="waveTexture" type="Texture"><![CDATA[./.]]></Property>
<Property name="near">8</Property>
<Property name="far">2000</Property>
<Property name="sourcepath"><![CDATA[./materials/water.shader]]></Property>
<Property name="importid"></Property>
<Property name="importfile"></Property>
<Property name="type">CustomMaterial</Property>
<Property name="name"><![CDATA[materials/Water]]></Property>
<Property name="path"><![CDATA[C:/Users/tetammin/Desktop/Island_ShaderExample/3d_presentation/materials/Water.materialdef]]></Property>
</MaterialData>
\ No newline at end of file
<Material name="blend" version="1.0">
<MetaData>
<Property formalName="Light X" name="lightx" type="Float" stage="vertex" default="1.0" category="Material" />
<Property formalName="Wind Power" name="windpower" type="Float" stage="vertex" default="1.0" category="Material" />
<Property formalName="Grass Texture" name="grass" type="Texture" filter="linear" clamp="repeat" category="Material"/>
<Property formalName="Rock Texture" name="rock" type="Texture" filter="linear" clamp="repeat" category="Material"/>
<Property formalName="Sand Texture" name="sand" type="Texture" filter="linear" clamp="repeat" category="Material"/>
<Property formalName="Caustics Map" name="caustics" type="Texture" filter="linear" clamp="repeat" category="Material"/>
<Property formalName="Value" name="value" type="Float" stage="vertex" default="1.0" category="Material" />
</MetaData>
<Shaders type="GLSL" version="330">
<Shader>
<VertexShader>
attribute vec3 attr_pos;
attribute vec2 attr_uv0;
attribute vec3 attr_color;
uniform mat4 modelViewProjection;
uniform mat4 viewMatrix;
uniform mat4 modelMatrix;
out vec2 v_uv;
out vec3 v_col;
out vec4 v_color;
out vec4 gl_Position;
out float v_y;
out float v_light;
out vec2 v_coord0;
out vec2 v_coord1;
out float v_power;
out float v_value;
void main() {
float causticSize = 4*windpower;
v_power = windpower;
float floorV = floor(value);
float row = floor(floorV / 6) ;
float valueX = floorV - (6 * row) ;
v_coord0.x = (attr_uv0.x/causticSize) / 6 + valueX / 6;
v_coord0.y = (attr_uv0.y/causticSize) / 6 +((6 - row - 1.0) / 6);
float floorV2 = floor(value + 1.0);
float row2 = floor(floorV2 / 6) ;
float valueX2 = floorV2 - (6 * row2) ;
v_coord0.x = (attr_uv0.x/causticSize) / 6 + valueX2 / 6;
v_coord0.y = (attr_uv0.y/causticSize) / 6 +((6 - row2 - 1.0) / 6);
vec3 light_pos = vec3(lightx,250.0,-600.0);
mat4 modelview = viewMatrix * modelMatrix;
vec3 modelViewVertex = vec3(modelview * vec4(attr_pos,1.0));
vec3 modelViewNormal = vec3(modelview * vec4(attr_pos,0.0));
float distance = length(light_pos - modelViewVertex);
vec3 lightVector = normalize(light_pos - modelViewVertex);
float diffuse = max(dot(modelViewNormal, lightVector), 0.1);
diffuse = diffuse * (1.0 / (1.0 + (0.25 * distance )))*12.5;
v_light = clamp(diffuse,0.0,0.7);
diffuse = clamp(diffuse,0.3,0.9);
v_color = vec4(diffuse,diffuse,diffuse,1.0);
v_uv = attr_uv0;
v_col = attr_color;
v_y = attr_pos.z;
gl_Position = modelViewProjection * vec4(attr_pos, 1.0);
}
</VertexShader>
<FragmentShader>
in float v_y;
in vec2 v_uv;
in vec3 v_col;
in vec4 v_color;
in float v_light;
in float v_value;
in vec2 v_coord0;
in vec2 v_coord1;
in float v_power;
vec4 finalOutput;
out vec4 fragOutput;
void main() {
vec4 tex = texture(caustics, v_coord0);
vec4 tex2 = texture(caustics, v_coord1);
float blender = fract(v_value);
vec4 o_caustics = tex * (1.0 - blender) + tex2 * blender;
vec4 splatGrass = texture(grass,v_uv);
vec4 splatRock = texture(rock,v_uv);
vec4 splatSand = texture(sand,v_uv);
finalOutput = vec4(splatGrass.rgb*v_col.g,1.0);
finalOutput += vec4(splatRock.rgb*v_col.b,1.0);
finalOutput += vec4(splatSand.rgb*v_col.r,1.0);
vec4 f_caustics;
if(v_y > -0.25){
f_caustics = vec4(0.0,0.0,0.0,1.0);
}
else{
f_caustics = vec4(vec3((o_caustics.rgb*-v_y)*(1.6-v_power)),1.0);
}
vec4 ambient = vec4(0.7,0.8,1.0,1.0);
fragOutput = finalOutput*v_color + (ambient*0.2)+(f_caustics*v_light);
}
</FragmentShader>
</Shader>
</Shaders>
<Passes>
<Pass>
</Pass>
</Passes>
</Material>
<Material name="skybox" version="1.0">
<MetaData>
<Property formalName="Time" name="time" type="Float" stage="vertex" default="1.0" category="Material" />
<Property formalName="Light X" name="lightx" type="Float" stage="vertex" default="1.0" category="Material" />
<Property formalName="Space Texture" name="spacemap" type="Texture" filter="linear" clamp="repeat" category="Material"/>
<Property formalName="Sky Texture" name="skymap" type="Texture" filter="linear" clamp="repeat" category="Material"/>
<Property formalName="Cloud Texture" name="cloudmap" type="Texture" filter="linear" clamp="repeat" category="Material"/>
</MetaData>
<Shaders type="GLSL" version="330">
<Shader>
<VertexShader>
attribute vec3 attr_pos;
attribute vec3 attr_color;
attribute vec2 attr_uv0;
uniform mat4 modelViewProjection;
uniform mat4 viewMatrix;
uniform mat4 modelMatrix;
out float rotateTime;
out vec3 v_col;
out vec2 v_uv;
out vec4 v_color;