forked from mirror/openmw-tes3mp
Some cleanup
parent
51fb9e67cd
commit
fe9e6a732c
Binary file not shown.
Before Width: | Height: | Size: 288 KiB |
@ -1,217 +0,0 @@
|
||||
// Derived from ogre samples
|
||||
|
||||
|
||||
vertex_program Water/GlassVP cg
|
||||
{
|
||||
source GlassVP.cg
|
||||
entry_point glass_vp
|
||||
profiles vs_1_1 arbvp1
|
||||
|
||||
default_params
|
||||
{
|
||||
param_named_auto worldViewProj worldviewproj_matrix
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fragment_program Water/GlassFP cg
|
||||
{
|
||||
source GlassFP.cg
|
||||
entry_point main_ps
|
||||
profiles ps_2_0 arbfp1
|
||||
}
|
||||
|
||||
material Water/Compositor
|
||||
{
|
||||
technique
|
||||
{
|
||||
pass
|
||||
{
|
||||
depth_check off
|
||||
|
||||
vertex_program_ref Water/GlassVP
|
||||
{
|
||||
param_named_auto timeVal time 0.25
|
||||
param_named scale float 0.1
|
||||
}
|
||||
|
||||
fragment_program_ref Water/GlassFP
|
||||
{
|
||||
param_named tintColour float4 0 0.35 0.35 1
|
||||
}
|
||||
|
||||
texture_unit RT
|
||||
{
|
||||
tex_coord_set 0
|
||||
tex_address_mode clamp
|
||||
filtering linear linear linear
|
||||
}
|
||||
|
||||
texture_unit
|
||||
{
|
||||
texture WaterNormal1.tga 2d
|
||||
tex_coord_set 1
|
||||
//tex_address_mode clamp
|
||||
filtering linear linear linear
|
||||
}
|
||||
texture_unit
|
||||
{
|
||||
texture caustic_0.png 2d
|
||||
tex_coord_set 2
|
||||
//tex_address_mode clamp
|
||||
filtering linear linear linear
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
vertex_program Water/RefractReflectVP cg
|
||||
{
|
||||
source Example_Fresnel.cg
|
||||
entry_point main_vp
|
||||
profiles vs_1_1 arbvp1
|
||||
}
|
||||
vertex_program Water/RefractReflectVPold cg
|
||||
{
|
||||
source Example_Fresnel.cg
|
||||
entry_point main_vp_old
|
||||
profiles vs_1_1 arbvp1
|
||||
}
|
||||
|
||||
fragment_program Water/RefractReflectFP cg
|
||||
{
|
||||
source Example_Fresnel.cg
|
||||
entry_point main_fp
|
||||
// sorry, ps_1_1 and fp20 can't do this
|
||||
profiles ps_2_0 arbfp1
|
||||
}
|
||||
|
||||
fragment_program Water/RefractReflectPS asm
|
||||
{
|
||||
source Example_FresnelPS.asm
|
||||
// sorry, only for ps_1_4 :)
|
||||
syntax ps_1_4
|
||||
|
||||
}
|
||||
|
||||
|
||||
material Water/ReflectionRefraction
|
||||
{
|
||||
// ps_2_0 / arbfp1
|
||||
technique
|
||||
{
|
||||
pass
|
||||
{
|
||||
|
||||
vertex_program_ref Water/RefractReflectVP
|
||||
{
|
||||
param_named_auto worldViewProjMatrix worldviewproj_matrix
|
||||
param_named_auto eyePosition camera_position_object_space
|
||||
param_named_auto timeVal time 0.15
|
||||
param_named scroll float 1
|
||||
param_named scale float 1
|
||||
param_named noise float 1
|
||||
// scroll and noisePos will need updating per frame
|
||||
}
|
||||
fragment_program_ref Water/RefractReflectFP
|
||||
{
|
||||
param_named fresnelBias float -0.1
|
||||
param_named fresnelScale float 0.8
|
||||
param_named fresnelPower float 20
|
||||
param_named tintColour float4 0 0.15 0.15 1
|
||||
param_named noiseScale float 0.05
|
||||
}
|
||||
// Water
|
||||
texture_unit
|
||||
{
|
||||
// Water texture
|
||||
texture Water02.jpg
|
||||
// min / mag filtering, no mip
|
||||
filtering linear linear none
|
||||
}
|
||||
// Noise
|
||||
texture_unit
|
||||
{
|
||||
// Perlin noise volume
|
||||
texture waves2.dds
|
||||
// min / mag filtering, no mip
|
||||
filtering linear linear none
|
||||
}
|
||||
// Reflection
|
||||
texture_unit
|
||||
{
|
||||
// Will be filled in at runtime
|
||||
texture reflection
|
||||
tex_address_mode clamp
|
||||
}
|
||||
// Refraction
|
||||
texture_unit
|
||||
{
|
||||
// Will be filled in at runtime
|
||||
texture refraction
|
||||
tex_address_mode clamp
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// ATI 8500 +
|
||||
technique
|
||||
{
|
||||
pass
|
||||
{
|
||||
vertex_program_ref Water/RefractReflectVPold
|
||||
{
|
||||
param_named_auto worldViewProjMatrix worldviewproj_matrix
|
||||
param_named_auto eyePosition camera_position_object_space
|
||||
param_named fresnelBias float -0.3
|
||||
param_named fresnelScale float 1.4
|
||||
param_named fresnelPower float 8
|
||||
param_named_auto timeVal time_0_1 20
|
||||
param_named scroll float 1
|
||||
param_named scale float 4
|
||||
param_named noise float 1
|
||||
// scroll and noisePos will need updating per frame
|
||||
}
|
||||
|
||||
// for ATI RADEON 8500 - 9200
|
||||
fragment_program_ref Water/RefractReflectPS
|
||||
{
|
||||
// distortionRange
|
||||
param_indexed 0 float 0.025
|
||||
// tintColour
|
||||
param_indexed 1 float4 0.05 0.12 0.15 1
|
||||
}
|
||||
|
||||
// Noise
|
||||
texture_unit
|
||||
{
|
||||
// Perlin noise volume
|
||||
texture perlinvolume.dds 3d
|
||||
// min / mag filtering, no mip
|
||||
filtering linear linear none
|
||||
}
|
||||
// Reflection
|
||||
texture_unit
|
||||
{
|
||||
// Will be filled in at runtime
|
||||
texture Reflection
|
||||
tex_address_mode clamp
|
||||
}
|
||||
// Refraction
|
||||
texture_unit
|
||||
{
|
||||
// Will be filled in at runtime
|
||||
texture Refraction
|
||||
tex_address_mode clamp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
void main( in float4 fresnel : COLOR0,
|
||||
in float4 inTex0 : TEXCOORD0,
|
||||
in float4 inTex1 : TEXCOORD1,
|
||||
in float4 inTex2 : TEXCOORD2,
|
||||
in float4 inTex3 : TEXCOORD3,
|
||||
in float4 inTex4 : COLOR1,
|
||||
in float4 inTex5 : BCOL1,
|
||||
out float4 outCol : COLOR,
|
||||
uniform float4 matrix,
|
||||
uniform sampler2D offsetTexture : texunit0,
|
||||
uniform sampler2D reflexTexture : texunit1,
|
||||
uniform sampler2D refractTexture : texunit2,
|
||||
uniform sampler2D depthTexture : texunit3)
|
||||
{
|
||||
float4 norm = tex2D(offsetTexture, inTex0.xy);
|
||||
float4 refr = tex2D(depthTexture, inTex3.xy);
|
||||
|
||||
float4 norm2 = tex2D(offsetTexture, inTex0.xy/10.0f);
|
||||
|
||||
float4 projCoord = inTex1 / inTex1.w;
|
||||
projCoord = (projCoord + 1.0) * 0.5;
|
||||
projCoord += norm * 0.02;
|
||||
projCoord = clamp(projCoord, 0.001, 0.999);
|
||||
|
||||
float4 reflexe = tex2D(reflexTexture, projCoord.xy);
|
||||
float4 refrakce = tex2D(refractTexture, projCoord.xy);
|
||||
|
||||
float4 odrazy = reflexe*(0.7+0.3*refr);
|
||||
|
||||
reflexe = (float4(0,0.4,0.4,1.0) + reflexe*0.5);
|
||||
|
||||
outCol = lerp(refrakce, reflexe, fresnel.r)-refr*0.08;
|
||||
|
||||
//outCol = lerp(refrakce, reflexe, fresnel.r);
|
||||
|
||||
// outCol = norm;
|
||||
|
||||
outCol.a = 1;
|
||||
}
|
Loading…
Reference in New Issue