[Orxonox-commit 7478] r12084 - data/branches/Shader_HS18/programs
wiesep at orxonox.net
wiesep at orxonox.net
Wed Nov 7 10:51:06 CET 2018
Author: wiesep
Date: 2018-11-07 10:51:06 +0100 (Wed, 07 Nov 2018)
New Revision: 12084
Removed:
data/branches/Shader_HS18/programs/AmbientOneTexture.glsl
data/branches/Shader_HS18/programs/BloomFP.cg
data/branches/Shader_HS18/programs/Blur0_ps20.hlsl
data/branches/Shader_HS18/programs/Blur0_vs.glsl
data/branches/Shader_HS18/programs/Blur0_vs11.hlsl
data/branches/Shader_HS18/programs/Blur1_ps20.hlsl
data/branches/Shader_HS18/programs/Blur1_vs.glsl
data/branches/Shader_HS18/programs/Blur1_vs11.hlsl
data/branches/Shader_HS18/programs/Blur_ps.glsl
data/branches/Shader_HS18/programs/BumpMapping.cg
data/branches/Shader_HS18/programs/Combine_fp.cg
data/branches/Shader_HS18/programs/Example_Basic.cg
data/branches/Shader_HS18/programs/Example_Basic.hlsl
data/branches/Shader_HS18/programs/GlassFP.cg
data/branches/Shader_HS18/programs/Grass.cg
data/branches/Shader_HS18/programs/GrayScale.cg
data/branches/Shader_HS18/programs/InvertFP.cg
data/branches/Shader_HS18/programs/LaplaceFP.cg
data/branches/Shader_HS18/programs/OldMovieFP.cg
data/branches/Shader_HS18/programs/OldTV.cg
data/branches/Shader_HS18/programs/PosterizeFP.cg
data/branches/Shader_HS18/programs/Radial_Blur_FP.cg
data/branches/Shader_HS18/programs/SharpenEdgesFP.cg
data/branches/Shader_HS18/programs/StdQuad_vp.cg
data/branches/Shader_HS18/programs/StdQuad_vp.glsl
data/branches/Shader_HS18/programs/TilingFP.cg
data/branches/Shader_HS18/programs/ToonShaderPS.cg
data/branches/Shader_HS18/programs/ToonShader_ps.frag
data/branches/Shader_HS18/programs/ToonShader_vs.vert
data/branches/Shader_HS18/programs/glow.cg
data/branches/Shader_HS18/programs/hdr.cg
data/branches/Shader_HS18/programs/hdr.hlsl
data/branches/Shader_HS18/programs/hdr_bloom.glsl
data/branches/Shader_HS18/programs/hdr_downscale2x2luminence.glsl
data/branches/Shader_HS18/programs/hdr_downscale3x3.glsl
data/branches/Shader_HS18/programs/hdr_downscale3x3brightpass.glsl
data/branches/Shader_HS18/programs/hdr_finalToneMapping.glsl
data/branches/Shader_HS18/programs/hdr_tonemap_util.glsl
data/branches/Shader_HS18/programs/ps_glow.cg
data/branches/Shader_HS18/programs/skinningTwoWeightsShadowCasterVp.glsl
data/branches/Shader_HS18/programs/skinningTwoWeightsVp.glsl
data/branches/Shader_HS18/programs/vs_glow.cg
Log:
Reorganised shader programs
Deleted: data/branches/Shader_HS18/programs/AmbientOneTexture.glsl
===================================================================
--- data/branches/Shader_HS18/programs/AmbientOneTexture.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/AmbientOneTexture.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,13 +0,0 @@
-uniform vec4 ambient;
-
-/*
- Basic ambient lighting vertex program
-*/
-void main()
-{
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_FrontColor = ambient;
-}
-
-
Deleted: data/branches/Shader_HS18/programs/BloomFP.cg
===================================================================
--- data/branches/Shader_HS18/programs/BloomFP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/BloomFP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,7 +0,0 @@
-sampler RT1 : register(s0);
-sampler RT2 : register(s1);
-
-float4 Bloom_ps (float2 iTexCoord : TEXCOORD0) : COLOR
-{
- return 0.5*tex2D(RT1, iTexCoord) + 0.5*tex2D(RT2, iTexCoord);
-}
Deleted: data/branches/Shader_HS18/programs/Blur0_ps20.hlsl
===================================================================
--- data/branches/Shader_HS18/programs/Blur0_ps20.hlsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Blur0_ps20.hlsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,31 +0,0 @@
-sampler RT: register(s0);
-// Simple blur filter
-
-float4 main(float2 texCoord: TEXCOORD0) : COLOR {
-
- float2 samples[12] = {
- -0.326212, -0.405805,
- -0.840144, -0.073580,
- -0.695914, 0.457137,
- -0.203345, 0.620716,
- 0.962340, -0.194983,
- 0.473434, -0.480026,
- 0.519456, 0.767022,
- 0.185461, -0.893124,
- 0.507431, 0.064425,
- 0.896420, 0.412458,
- -0.321940, -0.932615,
- -0.791559, -0.597705,
- };
-
- float4 sum = tex2D(RT, texCoord);
- for (int i = 0; i < 12; i++){
- sum += tex2D(RT, texCoord + 0.025 * samples[i]);
- }
- return sum / 13;
-
-}
-
-
-
-
Deleted: data/branches/Shader_HS18/programs/Blur0_vs.glsl
===================================================================
--- data/branches/Shader_HS18/programs/Blur0_vs.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Blur0_vs.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,15 +0,0 @@
-varying vec2 texCoord[5];
-
-void main()
-{
- vec2 inPos = sign(gl_Vertex.xy);
- gl_Position = vec4(inPos.xy, 0.0, 1.0);
-
- texCoord[0] = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
-
- const float size = 0.01;
- texCoord[1] = texCoord[0] + vec2(1.0, 0.0)*size;
- texCoord[2] = texCoord[0] + vec2(2.0, 0.0)*size;
- texCoord[3] = texCoord[0] + vec2(-1.0, 0.0)*size;
- texCoord[4] = texCoord[0] + vec2(-2.0, 0.0)*size;
-}
Deleted: data/branches/Shader_HS18/programs/Blur0_vs11.hlsl
===================================================================
--- data/branches/Shader_HS18/programs/Blur0_vs11.hlsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Blur0_vs11.hlsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,22 +0,0 @@
-struct VS_OUTPUT {
- float4 Pos: POSITION;
- float2 texCoord: TEXCOORD0;
-};
-
-VS_OUTPUT main(float4 Pos: POSITION){
- VS_OUTPUT Out;
-
- // Clean up inaccuracies
- Pos.xy = sign(Pos.xy);
-
- Out.Pos = float4(Pos.xy, 0, 1);
- // Image-space
- Out.texCoord.x = 0.5 * (1 + Pos.x);
- Out.texCoord.y = 0.5 * (1 - Pos.y);
-
- return Out;
-}
-
-
-
-
Deleted: data/branches/Shader_HS18/programs/Blur1_ps20.hlsl
===================================================================
--- data/branches/Shader_HS18/programs/Blur1_ps20.hlsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Blur1_ps20.hlsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,28 +0,0 @@
-sampler Blur0: register(s0);
-// Simple blur filter
-
-float4 main(float2 texCoord: TEXCOORD0) : COLOR {
-
- float2 samples[12] = {
- -0.326212, -0.405805,
- -0.840144, -0.073580,
- -0.695914, 0.457137,
- -0.203345, 0.620716,
- 0.962340, -0.194983,
- 0.473434, -0.480026,
- 0.519456, 0.767022,
- 0.185461, -0.893124,
- 0.507431, 0.064425,
- 0.896420, 0.412458,
- -0.321940, -0.932615,
- -0.791559, -0.597705,
- };
-
- float4 sum = tex2D(Blur0, texCoord);
- for (int i = 0; i < 12; i++){
- sum += tex2D(Blur0, texCoord + 0.025 * samples[i]);
- }
- return sum / 13;
-
-}
-
Deleted: data/branches/Shader_HS18/programs/Blur1_vs.glsl
===================================================================
--- data/branches/Shader_HS18/programs/Blur1_vs.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Blur1_vs.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,15 +0,0 @@
-varying vec2 texCoord[5];
-
-void main()
-{
- vec2 inPos = sign(gl_Vertex.xy);
- gl_Position = vec4(inPos.xy, 0.0, 1.0);
-
- texCoord[0] = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
-
- const float size = 0.01;
- texCoord[1] = texCoord[0] + vec2(0.0, 1.0)*size;
- texCoord[2] = texCoord[0] + vec2(0.0, 2.0)*size;
- texCoord[3] = texCoord[0] + vec2(0.0, -1.0)*size;
- texCoord[4] = texCoord[0] + vec2(0.0, -2.0)*size;
-}
Deleted: data/branches/Shader_HS18/programs/Blur1_vs11.hlsl
===================================================================
--- data/branches/Shader_HS18/programs/Blur1_vs11.hlsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Blur1_vs11.hlsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,19 +0,0 @@
-struct VS_OUTPUT {
- float4 Pos: POSITION;
- float2 texCoord: TEXCOORD0;
-};
-
-VS_OUTPUT main(float4 Pos: POSITION){
- VS_OUTPUT Out;
-
- // Clean up inaccuracies
- Pos.xy = sign(Pos.xy);
-
- Out.Pos = float4(Pos.xy, 0, 1);
- // Image-space
- Out.texCoord.x = 0.5 * (1 + Pos.x);
- Out.texCoord.y = 0.5 * (1 - Pos.y);
-
- return Out;
-}
-
Deleted: data/branches/Shader_HS18/programs/Blur_ps.glsl
===================================================================
--- data/branches/Shader_HS18/programs/Blur_ps.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Blur_ps.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,14 +0,0 @@
-uniform sampler2D tex0;
-
-varying vec2 texCoord[5];
-
-void main()
-{
- vec4 sum = texture2D(tex0, texCoord[0]) +
- texture2D(tex0, texCoord[1]) +
- texture2D(tex0, texCoord[2]) +
- texture2D(tex0, texCoord[3]) +
- texture2D(tex0, texCoord[4]);
- gl_FragColor = sum / 5.0;
-}
-
Deleted: data/branches/Shader_HS18/programs/BumpMapping.cg
===================================================================
--- data/branches/Shader_HS18/programs/BumpMapping.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/BumpMapping.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,152 +0,0 @@
-// General functions
-
-// Expand a range-compressed vector
-float3 expand(float3 v)
-{
- return (v - 0.5) * 2;
-}
-
-
-/* Bump mapping vertex program
- In this program, we want to calculate the tangent space light vector
- on a per-vertex level which will get passed to the fragment program,
- or to the fixed function dot3 operation, to produce the per-pixel
- lighting effect.
-*/
-void main_vp(float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float3 tangent : TANGENT0,
- // outputs
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float3 oTSLightDir : TEXCOORD1,
- // parameters
- uniform float4 lightPosition, // object space
- uniform float4x4 worldViewProj)
-{
- // calculate output position
- oPosition = mul(worldViewProj, position);
-
- // pass the main uvs straight through unchanged
- oUv = uv;
-
- // calculate tangent space light vector
- // Get object space light direction
- // Non-normalised since we'll do that in the fragment program anyway
- float3 lightDir = lightPosition.xyz - (position * lightPosition.w);
-
- // Calculate the binormal (NB we assume both normal and tangent are
- // already normalised)
- // NB looks like nvidia cross params are BACKWARDS to what you'd expect
- // this equates to NxT, not TxN
- float3 binormal = cross(tangent, normal);
-
- // Form a rotation matrix out of the vectors
- float3x3 rotation = float3x3(tangent, binormal, normal);
-
- // Transform the light vector according to this matrix
- oTSLightDir = mul(rotation, lightDir);
-
-
-}
-
-void main_fp( float2 uv : TEXCOORD0,
- float3 TSlightDir : TEXCOORD1,
-
- out float4 colour : COLOR,
-
- uniform float4 lightDiffuse,
- uniform sampler2D normalMap : register(s0),
- uniform samplerCUBE normalCubeMap : register(s1) )
-{
- // retrieve normalised light vector, expand from range-compressed
- float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
-
- // get bump map vector, again expand from range-compressed
- float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
-
- // Calculate dot product
- colour = lightDiffuse * dot(bumpVec, lightVec);
-
-}
-
-/* Vertex program which includes specular component */
-void specular_vp(float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float3 tangent : TANGENT0,
- // outputs
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float3 oTSLightDir : TEXCOORD1,
- out float3 oTSHalfAngle : TEXCOORD2,
- // parameters
- uniform float4 lightPosition, // object space
- uniform float3 eyePosition, // object space
- uniform float4x4 worldViewProj)
-{
- // calculate output position
- oPosition = mul(worldViewProj, position);
-
- // pass the main uvs straight through unchanged
- oUv = uv;
-
- // calculate tangent space light vector
- // Get object space light direction
- float3 lightDir = normalize(lightPosition.xyz - (position * lightPosition.w));
-
- // Calculate the binormal (NB we assume both normal and tangent are
- // already normalised)
- // NB looks like nvidia cross params are BACKWARDS to what you'd expect
- // this equates to NxT, not TxN
- float3 binormal = cross(tangent, normal);
-
- // Form a rotation matrix out of the vectors
- float3x3 rotation = float3x3(tangent, binormal, normal);
-
- // Transform the light vector according to this matrix
- oTSLightDir = mul(rotation, lightDir);
-
- // Calculate half-angle in tangent space
- float3 eyeDir = normalize(eyePosition - position.xyz);
- float3 halfAngle = normalize(eyeDir + lightDir);
- oTSHalfAngle = mul(rotation, halfAngle);
-
-
-}
-
-/* Fragment program which supports specular component */
-void specular_fp( float2 uv : TEXCOORD0,
- float3 TSlightDir : TEXCOORD1,
- float3 TShalfAngle: TEXCOORD2,
-
- out float4 colour : COLOR,
-
- uniform float4 lightDiffuse,
- uniform float4 lightSpecular,
- uniform float shine,
- uniform sampler2D normalMap : register(s0),
- uniform samplerCUBE normalCubeMap : register(s1),
- uniform samplerCUBE normalCubeMap2 : register(s2)) // we need this second binding to be compatible with ps_1_1, ps_2_0 could reuse the other
-{
- // retrieve normalised light vector, expand from range-compressed
- float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
-
- // retrieve half angle and normalise through cube map
- float3 halfAngle = expand(texCUBE(normalCubeMap2, TShalfAngle).xyz);
-
- // get bump map vector, again expand from range-compressed
- float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
-
-
- float specFactor = pow(dot(bumpVec, halfAngle),shine);
-
-
-
- // Calculate dot product for diffuse
- colour = (lightDiffuse * saturate(dot(bumpVec, lightVec))) +
- (lightSpecular * specFactor);
-
-}
-
Deleted: data/branches/Shader_HS18/programs/Combine_fp.cg
===================================================================
--- data/branches/Shader_HS18/programs/Combine_fp.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Combine_fp.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,15 +0,0 @@
-float4 Combine_fp
-(
- in float2 texCoord: TEXCOORD0,
-
- uniform sampler RT : register(s0),
- uniform sampler Sum : register(s1),
-
- uniform float blur
-) : COLOR
-{
- float4 render = tex2D(RT, texCoord);
- float4 sum = tex2D(Sum, texCoord);
-
- return lerp(render, sum, blur);
-}
Deleted: data/branches/Shader_HS18/programs/Example_Basic.cg
===================================================================
--- data/branches/Shader_HS18/programs/Example_Basic.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Example_Basic.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,272 +0,0 @@
-/*
- Basic ambient lighting vertex program
-*/
-void ambientOneTexture_vp(float4 position : POSITION,
- float2 uv : TEXCOORD0,
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform float4x4 worldViewProj,
- uniform float4 ambient)
-{
- oPosition = mul(worldViewProj, position);
- oUv = uv;
- colour = ambient;
-}
-
-/*
- Single-weight-per-vertex hardware skinning, 2 lights
- The trouble with vertex programs is they're not general purpose, but
- fixed function hardware skinning is very poorly supported
-*/
-void hardwareSkinningOneWeight_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float blendIdx : BLENDINDICES,
-
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 lightPos[2],
- uniform float4 lightDiffuseColour[2],
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
- // transform normal
- float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
- // Lighting - support point and directional
- float3 lightDir0 = normalize(
- lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
- float3 lightDir1 = normalize(
- lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
-
- oUv = uv;
- colour = ambient +
- (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
- (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
-
-}
-
-/*
- Single-weight-per-vertex hardware skinning, shadow-caster pass
-*/
-void hardwareSkinningOneWeightCaster_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float blendIdx : BLENDINDICES,
-
-
- out float4 oPosition : POSITION,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
-
- colour = ambient;
-
-}
-
-/*
- Two-weight-per-vertex hardware skinning, 2 lights
- The trouble with vertex programs is they're not general purpose, but
- fixed function hardware skinning is very poorly supported
-*/
-void hardwareSkinningTwoWeights_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float4 blendIdx : BLENDINDICES,
- float4 blendWgt : BLENDWEIGHT,
-
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 lightPos[2],
- uniform float4 lightDiffuseColour[2],
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(0,0,0,0);
- int i;
- for (i = 0; i < 2; ++i)
- {
- blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
- }
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
- // transform normal
- float3 norm = float3(0,0,0);
- for (i = 0; i < 2; ++i)
- {
- norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) *
- blendWgt[i];
- }
- norm = normalize(norm);
- // Lighting - support point and directional
- float3 lightDir0 = normalize(
- lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
- float3 lightDir1 = normalize(
- lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
-
-
- oUv = uv;
- colour = float4(0.5, 0.5, 0.5, 1) +
- (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
- (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
-
-}
-
-/*
- Two-weight-per-vertex hardware skinning, shadow caster pass
-*/
-void hardwareSkinningTwoWeightsCaster_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float4 blendIdx : BLENDINDICES,
- float4 blendWgt : BLENDWEIGHT,
-
-
- out float4 oPosition : POSITION,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(0,0,0,0);
- int i;
- for (i = 0; i < 2; ++i)
- {
- blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
- }
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
-
-
- colour = ambient;
-
-
-}
-
-
-/*
- Four-weight-per-vertex hardware skinning, 2 lights
- The trouble with vertex programs is they're not general purpose, but
- fixed function hardware skinning is very poorly supported
-*/
-void hardwareSkinningFourWeights_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float4 blendIdx : BLENDINDICES,
- float4 blendWgt : BLENDWEIGHT,
-
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 lightPos[2],
- uniform float4 lightDiffuseColour[2],
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(0,0,0,0);
- int i;
- for (i = 0; i < 4; ++i)
- {
- blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
- }
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
- // transform normal
- float3 norm = float3(0,0,0);
- for (i = 0; i < 4; ++i)
- {
- norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) *
- blendWgt[i];
- }
- norm = normalize(norm);
- // Lighting - support point and directional
- float3 lightDir0 = normalize(
- lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
- float3 lightDir1 = normalize(
- lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
-
-
- oUv = uv;
- colour = ambient +
- (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
- (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
-
-}
-
-void hardwareMorphAnimation(float3 pos1 : POSITION,
- float4 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float3 pos2 : TEXCOORD1,
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform float4x4 worldViewProj,
- uniform float4 anim_t)
-{
- // interpolate
- float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f);
-
- oPosition = mul(worldViewProj, interp);
- oUv = uv;
- colour = float4(1,0,0,1);
-}
-
-void hardwarePoseAnimation(float3 pos : POSITION,
- float4 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float3 pose1 : TEXCOORD1,
- float3 pose2 : TEXCOORD2,
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform float4x4 worldViewProj,
- uniform float4 anim_t)
-{
- // interpolate
- float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f);
-
- oPosition = mul(worldViewProj, interp);
- oUv = uv;
- colour = float4(1,0,0,1);
-}
Deleted: data/branches/Shader_HS18/programs/Example_Basic.hlsl
===================================================================
--- data/branches/Shader_HS18/programs/Example_Basic.hlsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Example_Basic.hlsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,273 +0,0 @@
-/*
- Basic ambient lighting vertex program
-*/
-void ambientOneTexture_vp(float4 position : POSITION,
- float2 uv : TEXCOORD0,
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform float4x4 worldViewProj,
- uniform float4 ambient)
-{
- oPosition = mul(worldViewProj, position);
- oUv = uv;
- colour = ambient;
-}
-
-/*
- Single-weight-per-vertex hardware skinning, 2 lights
- The trouble with vertex programs is they're not general purpose, but
- fixed function hardware skinning is very poorly supported
-*/
-void hardwareSkinningOneWeight_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float blendIdx : BLENDINDICES,
-
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 lightPos[2],
- uniform float4 lightDiffuseColour[2],
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
- // transform normal
- float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
- // Lighting - support point and directional
- float3 lightDir0 = normalize(
- lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
- float3 lightDir1 = normalize(
- lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
-
- oUv = uv;
- colour = ambient +
- (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
- (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
-
-}
-
-/*
- Single-weight-per-vertex hardware skinning, shadow-caster pass
-*/
-void hardwareSkinningOneWeightCaster_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float blendIdx : BLENDINDICES,
-
-
- out float4 oPosition : POSITION,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
-
- colour = ambient;
-
-}
-
-/*
- Two-weight-per-vertex hardware skinning, 2 lights
- The trouble with vertex programs is they're not general purpose, but
- fixed function hardware skinning is very poorly supported
-*/
-void hardwareSkinningTwoWeights_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float4 blendIdx : BLENDINDICES,
- float4 blendWgt : BLENDWEIGHT,
-
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 lightPos[2],
- uniform float4 lightDiffuseColour[2],
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(0,0,0,0);
- int i;
- for (i = 0; i < 2; ++i)
- {
- blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
- }
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
- // transform normal
- float3 norm = float3(0,0,0);
- for (i = 0; i < 2; ++i)
- {
- norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) *
- blendWgt[i];
- }
- norm = normalize(norm);
- // Lighting - support point and directional
- float3 lightDir0 = normalize(
- lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
- float3 lightDir1 = normalize(
- lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
-
-
- oUv = uv;
- colour = ambient +
- (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
- (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
-
-}
-
-/*
- Two-weight-per-vertex hardware skinning, shadow caster pass
-*/
-void hardwareSkinningTwoWeightsCaster_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float4 blendIdx : BLENDINDICES,
- float4 blendWgt : BLENDWEIGHT,
-
-
- out float4 oPosition : POSITION,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(0,0,0,0);
- int i;
- for (i = 0; i < 2; ++i)
- {
- blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
- }
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
-
-
- colour = ambient;
-
-
-}
-
-
-/*
- Four-weight-per-vertex hardware skinning, 2 lights
- The trouble with vertex programs is they're not general purpose, but
- fixed function hardware skinning is very poorly supported
-*/
-void hardwareSkinningFourWeights_vp(
- float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float4 blendIdx : BLENDINDICES,
- float4 blendWgt : BLENDWEIGHT,
-
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
- // Support up to 24 bones of float3x4
- // vs_1_1 only supports 96 params so more than this is not feasible
- uniform float3x4 worldMatrix3x4Array[24],
- uniform float4x4 viewProjectionMatrix,
- uniform float4 lightPos[2],
- uniform float4 lightDiffuseColour[2],
- uniform float4 ambient)
-{
- // transform by indexed matrix
- float4 blendPos = float4(0,0,0,0);
- int i;
- for (i = 0; i < 4; ++i)
- {
- blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
- }
- // view / projection
- oPosition = mul(viewProjectionMatrix, blendPos);
- // transform normal
- float3 norm = float3(0,0,0);
- for (i = 0; i < 4; ++i)
- {
- norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) *
- blendWgt[i];
- }
- norm = normalize(norm);
- // Lighting - support point and directional
- float3 lightDir0 = normalize(
- lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
- float3 lightDir1 = normalize(
- lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
-
-
- oUv = uv;
- colour = ambient +
- (saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) +
- (saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
-
-}
-
-void hardwareMorphAnimation(float3 pos1 : POSITION,
- float4 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float3 pos2 : TEXCOORD1,
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform float4x4 worldViewProj,
- uniform float4 anim_t)
-{
- // interpolate
- float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f);
-
- oPosition = mul(worldViewProj, interp);
- oUv = uv;
- colour = float4(1,0,0,1);
-}
-
-void hardwarePoseAnimation(float3 pos : POSITION,
- float4 normal : NORMAL,
- float2 uv : TEXCOORD0,
- float3 pose1 : TEXCOORD1,
- float3 pose2 : TEXCOORD2,
-
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform float4x4 worldViewProj,
- uniform float4 anim_t)
-{
- // interpolate
- float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f);
-
- oPosition = mul(worldViewProj, interp);
- oUv = uv;
- colour = float4(1,0,0,1);
-}
-
Deleted: data/branches/Shader_HS18/programs/GlassFP.cg
===================================================================
--- data/branches/Shader_HS18/programs/GlassFP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/GlassFP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,9 +0,0 @@
-sampler RT : register(s0);
-sampler NormalMap : register(s1);
-
-float4 main_ps(float2 iTexCoord : TEXCOORD0) : COLOR
-{
- float4 normal = 2 * (tex2D(NormalMap, iTexCoord * 2.5) - 0.5);
-
- return tex2D(RT, iTexCoord + normal.xy * 0.05);
-}
Deleted: data/branches/Shader_HS18/programs/Grass.cg
===================================================================
--- data/branches/Shader_HS18/programs/Grass.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Grass.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,31 +0,0 @@
-// Vertex program to wave some grass about
-// Simplistic, assumes base of the grass at 0
-void grass_vp(float4 position : POSITION,
- float3 normal : NORMAL,
- float2 uv : TEXCOORD0,
- out float4 oPosition : POSITION,
- out float2 oUv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform float4x4 worldViewProj,
- uniform float4 ambient,
- uniform float4 objSpaceLight,
- uniform float4 lightColour,
- uniform float4 offset)
-{
- float4 mypos = position;
- //offset = float4(0.5, 0, 0, 0);
- float4 factor = float4(1,1,1,1) - uv.yyyy;
- mypos = mypos + offset * factor;
- oPosition = mul(worldViewProj, mypos);
-
- oUv = uv;
- // get vertex light direction (support directional and point)
- float3 light = normalize(
- objSpaceLight.xyz - (position.xyz * objSpaceLight.w));
- float diffuseFactor = max(dot(normal, light), 0);
-
-
- colour = ambient + diffuseFactor * lightColour;
-}
-
Deleted: data/branches/Shader_HS18/programs/GrayScale.cg
===================================================================
--- data/branches/Shader_HS18/programs/GrayScale.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/GrayScale.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,18 +0,0 @@
-sampler RT : register(s0);
-
-float4 GrayScale_ps(float2 iTexCoord : TEXCOORD0) : COLOR
-{
- float3 greyscale = dot(tex2D(RT, iTexCoord).rgb, float3(0.3, 0.59, 0.11));
- return float4(greyscale, 1.0);
-}
-
-float4 Embossed_ps(float2 iTexCoord : TEXCOORD0) : COLOR
-{
- float4 Color;
- Color.a = 1.0f;
- Color.rgb = 0.5f;
- Color -= tex2D( RT, iTexCoord - 0.001)*2.0f;
- Color += tex2D( RT, iTexCoord + 0.001)*2.0f;
- Color.rgb = (Color.r+Color.g+Color.b)/3.0f;
- return Color;
-}
Deleted: data/branches/Shader_HS18/programs/InvertFP.cg
===================================================================
--- data/branches/Shader_HS18/programs/InvertFP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/InvertFP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,6 +0,0 @@
-sampler RT : register(s0);
-
-float4 Invert_ps (float2 iTexCoord : TEXCOORD0) : COLOR
-{
- return 1 - tex2D(RT, iTexCoord);
-}
Deleted: data/branches/Shader_HS18/programs/LaplaceFP.cg
===================================================================
--- data/branches/Shader_HS18/programs/LaplaceFP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/LaplaceFP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,36 +0,0 @@
-sampler Image : register(s0);
-
-// The Laplace filter approximates the second order derivate,
-// that is, the rate of change of slope in the image. It can be
-// used for edge detection. The Laplace filter gives negative
-// response on the higher side of the edge and positive response
-// on the lower side.
-
-// This is the filter kernel:
-// 0 1 0
-// 1 -4 1
-// 0 1 0
-
-
-
-float4 Laplace_ps (float2 texCoord: TEXCOORD0,
- uniform float scale,
- uniform float pixelSize) : COLOR
-{
-
- float2 samples[4] = {
- 0, -1,
- -1, 0,
- 1, 0,
- 0, 1
- };
- float4 laplace = -4 * tex2D(Image, texCoord);
-
- // Sample the neighbor pixels
- for (int i = 0; i < 4; i++){
- laplace += tex2D(Image, texCoord + pixelSize * samples[i]);
- }
-
- return (0.5 + scale * laplace);
-}
-
Deleted: data/branches/Shader_HS18/programs/OldMovieFP.cg
===================================================================
--- data/branches/Shader_HS18/programs/OldMovieFP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/OldMovieFP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,54 +0,0 @@
-sampler RT : register(s0);
-sampler SplotchesTx : register(s1);
-sampler Texture2 : register(s2);
-sampler SepiaTx : register(s3);
-
-float2 calcSpriteAddr(float2 texCoord, float DirtFrequency, float period)
-{
- return texCoord + tex1D(Texture2, period * DirtFrequency);
-}
-
-float4 getSplotches(float2 spriteAddr)
-{
- // get sprite address into paged texture coords space
- spriteAddr = spriteAddr / 6.3f;
- //spriteAddr = spriteAddr - frac(spriteAddr);
- spriteAddr = spriteAddr - (spriteAddr /33.3f);
-
- return tex2D(SplotchesTx, spriteAddr);
-}
-
-float4 OldMovie_ps (float2 texCoord : TEXCOORD0,
- uniform float time_cycle_period,
- uniform float flicker,
- uniform float DirtFrequency,
- uniform float3 luminance,
- uniform float frameJitter,
- uniform float lumiShift
- ) : COLOR
-{
-
- // get sprite address
- float2 spriteAddr = calcSpriteAddr(texCoord, DirtFrequency, time_cycle_period);
-
- // add some dark and light splotches to the film
- float4 splotches = getSplotches(spriteAddr);
- float4 specs = 1.0f - getSplotches(spriteAddr / 3.0f);
-
- // convert color to base luminance
- float4 base = tex2D(RT, texCoord + float2(0, spriteAddr.y * frameJitter));
- float lumi = dot(base.rgb, luminance);
- // randomly shift luminance
- lumi -= spriteAddr.x * lumiShift;
- // tone map luminance
- base.rgb = tex1D(SepiaTx, lumi );
-
- // calc flicker speed
- float darken = frac(flicker * time_cycle_period);
-
- // we want darken to cycle between 0.6 and 1.0
- darken = abs(darken - 0.5f) * 0.4f + 0.6f;
- // composite dirt onto film
- return base * splotches * darken + specs;
-}
-
Deleted: data/branches/Shader_HS18/programs/OldTV.cg
===================================================================
--- data/branches/Shader_HS18/programs/OldTV.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/OldTV.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,42 +0,0 @@
-
-
-sampler Image: register(s0);
-sampler Rand: register(s1);
-sampler Noise: register(s2);
-
-float4 OldTV_ps(float2 pos: TEXCOORD1, float2 img: TEXCOORD0,
- uniform float distortionFreq: register(c3),
- uniform float distortionScale: register(c4),
- uniform float distortionRoll: register(c5),
- uniform float interference: register(c7),
- uniform float frameLimit: register(c8),
- uniform float frameShape: register(c0),
- uniform float frameSharpness: register(c1),
- uniform float time_0_X: register(c2),
- uniform float sin_time_0_X: register(c6)
-
-) : COLOR {
- // Define a frame shape
- float f = (1 - pos.x * pos.x) * (1 - pos.y * pos.y);
- float frame = saturate(frameSharpness * (pow(f, frameShape) - frameLimit));
-
- // Interference ... just a texture filled with rand()
- float rand = tex3D(Rand, float3(1.5 * pos, time_0_X)) - 0.2;
-
- // Some signed noise for the distortion effect
- float noisy = tex3D(Noise, float3(0, 0.5 * pos.y, 0.1 * time_0_X)) - 0.5;
-
- // Repeat a 1 - x^2 (0 < x < 1) curve and roll it with sinus.
- float dst = frac(pos.y * distortionFreq + distortionRoll * sin_time_0_X);
- dst *= (1 - dst);
- // Make sure distortion is highest in the center of the image
- dst /= 1 + distortionScale * abs(pos.y);
-
- // ... and finally distort
- img.x += distortionScale * noisy * dst;
- float4 image = tex2D(Image, img);
-
- // Combine frame, distorted image and interference
- return frame * (interference * rand + image);
-}
-
Deleted: data/branches/Shader_HS18/programs/PosterizeFP.cg
===================================================================
--- data/branches/Shader_HS18/programs/PosterizeFP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/PosterizeFP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,17 +0,0 @@
-sampler RT : register(s0);
-
-float4 Posterize_ps (float2 iTexCoord : TEXCOORD0) : COLOR
-{
-
- float nColors = 8;
- float gamma = 0.6;
-
- float4 texCol = tex2D(RT, iTexCoord);
- float3 tc = texCol.xyz;
- tc = pow(tc, gamma);
- tc = tc * nColors;
- tc = floor(tc);
- tc = tc / nColors;
- tc = pow(tc,1.0/gamma);
- return float4(tc,texCol.w);
-}
Deleted: data/branches/Shader_HS18/programs/Radial_Blur_FP.cg
===================================================================
--- data/branches/Shader_HS18/programs/Radial_Blur_FP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/Radial_Blur_FP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,57 +0,0 @@
-//------------------------------------------------------
-//Radial_Blur_FP.cg
-// Implements radial blur to be used with the compositor
-// It's very dependant on screen resolution
-//------------------------------------------------------
-
-uniform sampler tex: register(s0);
-
-static const float samples[10] =
-{
--0.08,
--0.05,
--0.03,
--0.02,
--0.01,
-0.01,
-0.02,
-0.03,
-0.05,
-0.08
-};
-
-float4 main(float2 texCoord: TEXCOORD0,
- uniform float sampleDist,
- uniform float sampleStrength
- ) : COLOR
-{
- //Vector from pixel to the center of the screen
- float2 dir = 0.5 - texCoord;
-
- //Distance from pixel to the center (distant pixels have stronger effect)
- //float dist = distance( float2( 0.5, 0.5 ), texCoord );
- float dist = sqrt( dir.x*dir.x + dir.y*dir.y );
-
-
- //Now that we have dist, we can normlize vector
- dir = normalize( dir );
-
- //Save the color to be used later
- float4 color = tex2D( tex, texCoord );
-
- //Average the pixels going along the vector
- float4 sum = color;
- for (int i = 0; i < 10; i++)
- {
- sum += tex2D( tex, texCoord + dir * samples[i] * sampleDist );
- }
- sum /= 11;
-
- //Calculate amount of blur based on
- //distance and a strength parameter
- float t = dist * sampleStrength;
- t = saturate( t );//We need 0 <= t <= 1
-
- //Blend the original color with the averaged pixels
- return lerp( color, sum, t );
-}
Deleted: data/branches/Shader_HS18/programs/SharpenEdgesFP.cg
===================================================================
--- data/branches/Shader_HS18/programs/SharpenEdgesFP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/SharpenEdgesFP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,23 +0,0 @@
-sampler RT: register(s0);
-
-float4 sharpenEdges_fp(float2 iTexCoord: TEXCOORD0, uniform float2 vTexelSize) : COLOR
-{
-
- float2 usedTexelED[8] = {
- -1, -1,
- 0, -1,
- 1, -1,
- -1, 0,
- 1, 0,
- -1, 1,
- 0, 1,
- 1, 1,
- };
-
- float4 cAvgColor= 9 * tex2D (RT, iTexCoord);
-
- for(int t=0; t<8; t++)
- cAvgColor -= tex2D(RT, iTexCoord + vTexelSize * usedTexelED[t]);
-
- return cAvgColor;
-}
Deleted: data/branches/Shader_HS18/programs/StdQuad_vp.cg
===================================================================
--- data/branches/Shader_HS18/programs/StdQuad_vp.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/StdQuad_vp.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,113 +0,0 @@
-void StdQuad_vp
-(
- in float4 inPos : POSITION,
-
- out float4 pos : POSITION,
- out float2 uv0 : TEXCOORD0,
-
- uniform float4x4 worldViewProj
-)
-{
- // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
- pos = mul(worldViewProj, inPos);
-
- // The input positions adjusted by texel offsets, so clean up inaccuracies
- inPos.xy = sign(inPos.xy);
-
- // Convert to image-space
- uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
-}
-
-void StdQuad_Tex2_vp
-(
- in float4 inPos : POSITION,
-
- out float4 pos : POSITION,
- out float2 uv0 : TEXCOORD0,
- out float2 uv1 : TEXCOORD1,
-
- uniform float4x4 worldViewProj
-)
-{
- // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
- pos = mul(worldViewProj, inPos);
-
- // The input positions adjusted by texel offsets, so clean up inaccuracies
- inPos.xy = sign(inPos.xy);
-
- // Convert to image-space
- uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
- uv1 = uv0;
-}
-
-void StdQuad_Tex2a_vp
-(
- in float4 inPos : POSITION,
-
- out float4 pos : POSITION,
- out float2 uv0 : TEXCOORD0,
- out float2 uv1 : TEXCOORD1,
-
- uniform float4x4 worldViewProj
-)
-{
- // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
- pos = mul(worldViewProj, inPos);
-
- // The input positions adjusted by texel offsets, so clean up inaccuracies
- inPos.xy = sign(inPos.xy);
-
- // Convert to image-space
- uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
- uv1 = inPos.xy;
-}
-
-void StdQuad_Tex3_vp
-(
- in float4 inPos : POSITION,
-
- out float4 pos : POSITION,
- out float2 uv0 : TEXCOORD0,
- out float2 uv1 : TEXCOORD1,
- out float2 uv2 : TEXCOORD2,
-
- uniform float4x4 worldViewProj
-)
-{
- // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
- pos = mul(worldViewProj, inPos);
-
- // The input positions adjusted by texel offsets, so clean up inaccuracies
- inPos.xy = sign(inPos.xy);
-
- // Convert to image-space
- uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
- uv1 = uv0;
- uv2 = uv0;
-}
-
-void StdQuad_Tex4_vp
-(
- in float4 inPos : POSITION,
-
- out float4 pos : POSITION,
- out float2 uv0 : TEXCOORD0,
- out float2 uv1 : TEXCOORD1,
- out float2 uv2 : TEXCOORD2,
- out float2 uv3 : TEXCOORD3,
-
- uniform float4x4 worldViewProj
-)
-{
- // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
- pos = mul(worldViewProj, inPos);
-
- // The input positions adjusted by texel offsets, so clean up inaccuracies
- inPos.xy = sign(inPos.xy);
-
- // Convert to image-space
- uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
- uv1 = uv0;
- uv2 = uv0;
- uv3 = uv0;
-}
Deleted: data/branches/Shader_HS18/programs/StdQuad_vp.glsl
===================================================================
--- data/branches/Shader_HS18/programs/StdQuad_vp.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/StdQuad_vp.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,11 +0,0 @@
-varying vec2 uv;
-
-void main()
-{
- gl_Position = ftransform();
-
- vec2 inPos = sign(gl_Vertex.xy);
-
- uv = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
-}
-
Deleted: data/branches/Shader_HS18/programs/TilingFP.cg
===================================================================
--- data/branches/Shader_HS18/programs/TilingFP.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/TilingFP.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,33 +0,0 @@
-sampler RT : register(s0);
-
-float4 Tiling_ps(float4 inPos : POSITION,
- float2 iTexCoord : TEXCOORD0,
- uniform half NumTiles,
- uniform half Threshhold) : COLOR
-{
-
-
- half3 EdgeColor = {0.7, 0.7, 0.7};
-
- half size = 1.0/NumTiles;
- half2 Pbase = iTexCoord - fmod(iTexCoord, size.xx);
- half2 PCenter = Pbase + (size/2.0).xx;
- half2 st = (iTexCoord - Pbase)/size;
- half4 c1 = (half4)0;
- half4 c2 = (half4)0;
- half4 invOff = half4((1-EdgeColor),1);
- if (st.x > st.y) { c1 = invOff; }
- half threshholdB = 1.0 - Threshhold;
- if (st.x > threshholdB) { c2 = c1; }
- if (st.y > threshholdB) { c2 = c1; }
- half4 cBottom = c2;
- c1 = (half4)0;
- c2 = (half4)0;
- if (st.x > st.y) { c1 = invOff; }
- if (st.x < Threshhold) { c2 = c1; }
- if (st.y < Threshhold) { c2 = c1; }
- half4 cTop = c2;
- half4 tileColor = tex2D(RT, PCenter);
- half4 result = tileColor + cTop - cBottom;
- return result;
-}
Deleted: data/branches/Shader_HS18/programs/ToonShaderPS.cg
===================================================================
--- data/branches/Shader_HS18/programs/ToonShaderPS.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/ToonShaderPS.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,11 +0,0 @@
-float4 main(in float3 texCoord: TEXCOORD0) : COLOR
-{
- float4 c;
-
- c.r = 0.9;
- c.g = 0.8;
- c.b = 0.1;
- c.a = 0.0;
-
- return c;
-}
Deleted: data/branches/Shader_HS18/programs/ToonShader_ps.frag
===================================================================
--- data/branches/Shader_HS18/programs/ToonShader_ps.frag 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/ToonShader_ps.frag 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,4 +0,0 @@
-void main()
-{
- gl_FragColor = vec4(0.4, 0.4, 0.8, 1.0);
-}
Deleted: data/branches/Shader_HS18/programs/ToonShader_vs.vert
===================================================================
--- data/branches/Shader_HS18/programs/ToonShader_vs.vert 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/ToonShader_vs.vert 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,4 +0,0 @@
-void main()
-{
- gl_Position = ftransform();
-}
Deleted: data/branches/Shader_HS18/programs/glow.cg
===================================================================
--- data/branches/Shader_HS18/programs/glow.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/glow.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,72 +0,0 @@
-//A.
-float4 GlowX_fp
- (
- float2 uv: TEXCOORD0,
-
- uniform sampler2D scene: register(s0),
- uniform float4 invTexSize
- ) : COLOR
-#define RENDER_SCENE 1
-#define BLUR_RADIUS 1
-{
- float4 colour = float4(0);
- float blurSize = BLUR_RADIUS * invTexSize.x;
-
- //X-blur.
- int x = uv.x/blurSize;
- colour += tex2D(scene, float2((x - 4.0) * blurSize, uv.y)) * 1.0/25.0;
- colour += tex2D(scene, float2((x - 3.0) * blurSize, uv.y)) * 2.0/25.0;
- colour += tex2D(scene, float2((x - 2.0) * blurSize, uv.y)) * 3.0/25.0;
- colour += tex2D(scene, float2((x - 1.0) * blurSize, uv.y)) * 4.0/25.0;
- colour += tex2D(scene, float2((x + 0.0) * blurSize, uv.y)) * 5.0/25.0;
- colour += tex2D(scene, float2((x + 1.0) * blurSize, uv.y)) * 4.0/25.0;
- colour += tex2D(scene, float2((x + 2.0) * blurSize, uv.y)) * 3.0/25.0;
- colour += tex2D(scene, float2((x + 3.0) * blurSize, uv.y)) * 2.0/25.0;
- colour += tex2D(scene, float2((x + 4.0) * blurSize, uv.y)) * 1.0/25.0;
-
- return colour;
-}
-
-//B.
-float4 GlowY_fp
- (
- float2 uv: TEXCOORD0,
-
- uniform sampler2D blurX: register(s0),
- uniform float4 invTexSize
- ) : COLOR
-{
- float4 colour = float4(0);
- float blurSize = BLUR_RADIUS * invTexSize.y;
-
- //Y-blur.
- int y = uv.y/blurSize;
- colour += tex2D(blurX, float2(uv.x, (y - 4.0) * blurSize)) * 1.0/25.0;
- colour += tex2D(blurX, float2(uv.x, (y - 3.0) * blurSize)) * 2.0/25.0;
- colour += tex2D(blurX, float2(uv.x, (y - 2.0) * blurSize)) * 3.0/25.0;
- colour += tex2D(blurX, float2(uv.x, (y - 1.0) * blurSize)) * 4.0/25.0;
- colour += tex2D(blurX, float2(uv.x, (y + 0.0) * blurSize)) * 5.0/25.0;
- colour += tex2D(blurX, float2(uv.x, (y + 1.0) * blurSize)) * 4.0/25.0;
- colour += tex2D(blurX, float2(uv.x, (y + 2.0) * blurSize)) * 3.0/25.0;
- colour += tex2D(blurX, float2(uv.x, (y + 3.0) * blurSize)) * 2.0/25.0;
- colour += tex2D(blurX, float2(uv.x, (y + 4.0) * blurSize)) * 1.0/25.0;
-
- return colour;
-}
-
-//C.
-float4 GlowBlend_fp
- (
- float2 uv: TEXCOORD0,
-
- uniform sampler2D scene: register(s0),
- uniform sampler2D blurXY: register(s1)
- ) : COLOR
-{
- //Add this to original, return.
- return
-#if RENDER_SCENE
- tex2D(scene, uv) +
-#endif
- tex2D(blurXY, uv) * 1;
-}
Deleted: data/branches/Shader_HS18/programs/hdr.cg
===================================================================
--- data/branches/Shader_HS18/programs/hdr.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/hdr.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,25 +0,0 @@
-void morningskybox_fp (
- float2 uv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform sampler2D tex : register(s0) )
-{
- colour = tex2D(tex, uv);
-
- // blow out the light a bit
- colour *= 1.7;
-}
-void morningcubemap_fp (
- float3 uv : TEXCOORD0,
- out float4 colour : COLOR,
-
- uniform samplerCUBE tex : register(s0) )
-{
- colour = texCUBE(tex, uv);
-
- // blow out the light a bit
- colour *= 1.7;
-}
-
-
-
Deleted: data/branches/Shader_HS18/programs/hdr.hlsl
===================================================================
--- data/branches/Shader_HS18/programs/hdr.hlsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/hdr.hlsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,228 +0,0 @@
-// RGBE mode utilities
-// RGB each carry a mantissa, A carries a shared exponent
-// The exponent is calculated based on the largest colour channel
-
-
-float3 decodeRGBE8(in float4 rgbe)
-{
- // get exponent (-128 since it can be +ve or -ve)
- float exp = rgbe.a * 255 - 128;
-
- // expand out the rgb value
- return rgbe.rgb * exp2(exp);
-}
-
-float4 encodeRGBE8(in float3 rgb)
-{
- float4 ret;
-
- // What is the largest colour channel?
- float highVal = max(rgb.r, max(rgb.g, rgb.b));
-
- // Take the logarithm, clamp it to a whole value
- float exp = ceil(log2(highVal));
-
- // Divide the components by the shared exponent
- ret.rgb = rgb / exp2(exp);
-
- // Store the shared exponent in the alpha channel
- ret.a = (exp + 128) / 255;
-
- return ret;
-}
-
-
-static const float4 LUMINENCE_FACTOR = float4(0.27f, 0.67f, 0.06f, 0.0f);
-static const float MIDDLE_GREY = 0.72f;
-static const float FUDGE = 0.001f;
-static const float L_WHITE = 1.5f;
-static const float4 BRIGHT_LIMITER = float4(0.6f, 0.6f, 0.6f, 0.0f);
-
-
-/** Tone mapping function
- at note Only affects rgb, not a
- at param inColour The HDR colour
- at param lum The scene lumninence
- at returns Tone mapped colour
-*/
-float4 toneMap(float4 inColour, float lum)
-{
- // From Reinhard et al
- // "Photographic Tone Reproduction for Digital Images"
-
- // Initial luminence scaling (equation 2)
- inColour.rgb *= MIDDLE_GREY / (FUDGE + lum);
-
- // Control white out (equation 4 nom)
- inColour.rgb *= (1.0f + inColour / L_WHITE);
-
- // Final mapping (equation 4 denom)
- inColour.rgb /= (1.0f + inColour);
-
- return inColour;
-
-}
-
-/* Downsample a 2x2 area and convert to greyscale
-*/
-float4 downscale2x2Luminence(
- float2 uv : TEXCOORD0,
- uniform float2 texelSize, // depends on size of source texture
- uniform sampler2D inRTT : register(s0)
- ) : COLOR
-{
-
- float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
-
- float2 texOffset[4] = {
- -0.5, -0.5,
- -0.5, 0.5,
- 0.5, -0.5,
- 0.5, 0.5 };
-
- for( int i = 0; i < 4; i++ )
- {
- // Get colour from source
- accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
- }
-
- // Adjust the accumulated amount by lum factor
- // Cannot use float3's here because it generates dependent texture errors because of swizzle
- float lum = dot(accum, LUMINENCE_FACTOR);
- // take average of 4 samples
- lum *= 0.25;
- return lum;
-
-}
-
-/* Downsample a 3x3 area
- * This shader is used multiple times on different source sizes, so texel size has to be configurable
-*/
-float4 downscale3x3(
- float2 uv : TEXCOORD0,
- uniform float2 texelSize, // depends on size of source texture
- uniform sampler2D inRTT : register(s0)
- ) : COLOR
-{
-
- float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
-
- float2 texOffset[9] = {
- -1.0, -1.0,
- 0.0, -1.0,
- 1.0, -1.0,
- -1.0, 0.0,
- 0.0, 0.0,
- 1.0, 0.0,
- -1.0, 1.0,
- 0.0, 1.0,
- 1.0, 1.0
- };
-
- for( int i = 0; i < 9; i++ )
- {
- // Get colour from source
- accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
- }
-
- // take average of 9 samples
- accum *= 0.1111111111111111;
- return accum;
-
-}
-
-/* Downsample a 3x3 area from main RTT and perform a brightness pass
-*/
-float4 downscale3x3brightpass(
- float2 uv : TEXCOORD0,
- uniform float2 texelSize, // depends on size of source texture
- uniform sampler2D inRTT : register(s0),
- uniform sampler2D inLum : register(s1)
- ) : COLOR
-{
-
- float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
-
- float2 texOffset[9] = {
- -1.0, -1.0,
- 0.0, -1.0,
- 1.0, -1.0,
- -1.0, 0.0,
- 0.0, 0.0,
- 1.0, 0.0,
- -1.0, 1.0,
- 0.0, 1.0,
- 1.0, 1.0
- };
-
- for( int i = 0; i < 9; i++ )
- {
- // Get colour from source
- accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
- }
-
- // take average of 9 samples
- accum *= 0.1111111111111111;
-
- // Reduce bright and clamp
- accum = max(float4(0.0f, 0.0f, 0.0f, 1.0f), accum - BRIGHT_LIMITER);
-
- // Sample the luminence texture
- float4 lum = tex2D(inLum, float2(0.5f, 0.5f));
-
- // Tone map result
- return toneMap(accum, lum.r);
-
-}
-
-/* Gaussian bloom, requires offsets and weights to be provided externally
-*/
-float4 bloom(
- float2 uv : TEXCOORD0,
- uniform float2 sampleOffsets[15],
- uniform float4 sampleWeights[15],
- uniform sampler2D inRTT : register(s0)
- ) : COLOR
-{
- float4 accum = float4(0.0f, 0.0f, 0.0f, 1.0f);
- float2 sampleUV;
-
- for( int i = 0; i < 15; i++ )
- {
- // Sample from adjacent points, 7 each side and central
- sampleUV = uv + sampleOffsets[i];
- accum += sampleWeights[i] * tex2D(inRTT, sampleUV);
- }
-
- return accum;
-
-}
-
-
-/* Final scene composition, with tone mapping
-*/
-float4 finalToneMapping(
- float2 uv : TEXCOORD0,
- uniform sampler2D inRTT : register(s0),
- uniform sampler2D inBloom : register(s1),
- uniform sampler2D inLum : register(s2)
- ) : COLOR
-{
- // Get main scene colour
- float4 sceneCol = tex2D(inRTT, uv);
-
- // Get luminence value
- float4 lum = tex2D(inLum, float2(0.5f, 0.5f));
-
- // tone map this
- float4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
-
- // Get bloom colour
- float4 bloom = tex2D(inBloom, uv);
-
- // Add scene & bloom
- return float4(toneMappedSceneCol.rgb + bloom.rgb, 1.0f);
-
-}
-
-
Deleted: data/branches/Shader_HS18/programs/hdr_bloom.glsl
===================================================================
--- data/branches/Shader_HS18/programs/hdr_bloom.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/hdr_bloom.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,22 +0,0 @@
-uniform sampler2D inRTT;
-
-uniform vec4 sampleOffsets[15];
-uniform vec4 sampleWeights[15];
-
-varying vec2 uv;
-
-void main(void)
-{
- vec4 accum = vec4(0.0, 0.0, 0.0, 1.0);
- vec2 sampleUV;
-
- for( int i = 0; i < 15; i++ )
- {
- // Sample from adjacent points, 7 each side and central
- sampleUV = uv + sampleOffsets[i].xy;
- accum += sampleWeights[i] * texture2D(inRTT, sampleUV);
- }
-
- gl_FragColor = accum;
-
-}
Deleted: data/branches/Shader_HS18/programs/hdr_downscale2x2luminence.glsl
===================================================================
--- data/branches/Shader_HS18/programs/hdr_downscale2x2luminence.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/hdr_downscale2x2luminence.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,24 +0,0 @@
-uniform sampler2D inRTT;
-uniform vec2 texelSize;
-
-varying vec2 uv;
-
-void main(void)
-{
-
- vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
- vec4 LUMINENCE_FACTOR = vec4(0.27, 0.67, 0.06, 0.0);
-
- // Get colour from source
- accum += texture2D(inRTT, uv + texelSize * vec2(-0.5, -0.5));
- accum += texture2D(inRTT, uv + texelSize * vec2(-0.5, 0.5));
- accum += texture2D(inRTT, uv + texelSize * vec2(0.5, 0.5));
- accum += texture2D(inRTT, uv + texelSize * vec2(0.5, -0.5));
-
- // Adjust the accumulated amount by lum factor
- float lum = dot(accum, LUMINENCE_FACTOR);
- // take average of 4 samples
- lum *= 0.25;
- gl_FragColor = vec4(lum, lum, lum, 1.0);
-
-}
Deleted: data/branches/Shader_HS18/programs/hdr_downscale3x3.glsl
===================================================================
--- data/branches/Shader_HS18/programs/hdr_downscale3x3.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/hdr_downscale3x3.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,26 +0,0 @@
-uniform sampler2D inRTT;
-uniform vec2 texelSize;
-
-varying vec2 uv;
-
-void main(void)
-{
- vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
-
- // Get colour from source
- accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 0.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 0.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 0.0));
- accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 1.0));
-
- // take average of 9 samples
- accum *= 0.1111111111111111;
-
- gl_FragColor = accum;
-
-}
Deleted: data/branches/Shader_HS18/programs/hdr_downscale3x3brightpass.glsl
===================================================================
--- data/branches/Shader_HS18/programs/hdr_downscale3x3brightpass.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/hdr_downscale3x3brightpass.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,37 +0,0 @@
-uniform sampler2D inRTT;
-uniform sampler2D inLum;
-uniform vec2 texelSize;
-
-varying vec2 uv;
-const vec4 BRIGHT_LIMITER = vec4(0.6, 0.6, 0.6, 0.0);
-
-// declare external function
-vec4 toneMap(in vec4 inColour, in float lum);
-
-void main(void)
-{
- vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
-
- accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 0.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 0.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 0.0));
- accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, 1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, 1.0));
- accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, 1.0));
-
- // take average of 9 samples
- accum *= 0.1111111111111111;
-
- // Reduce bright and clamp
- accum = max(vec4(0.0, 0.0, 0.0, 1.0), accum - BRIGHT_LIMITER);
-
- // Sample the luminence texture
- vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
-
- // Tone map result
- gl_FragColor = toneMap(accum, lum.r);
-
-}
Deleted: data/branches/Shader_HS18/programs/hdr_finalToneMapping.glsl
===================================================================
--- data/branches/Shader_HS18/programs/hdr_finalToneMapping.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/hdr_finalToneMapping.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,28 +0,0 @@
-uniform sampler2D inRTT;
-uniform sampler2D inBloom;
-uniform sampler2D inLum;
-
-varying vec2 uv;
-
-// declare external function
-vec4 toneMap(in vec4 inColour, in float lum);
-
-void main(void)
-{
- // Get main scene colour
- vec4 sceneCol = texture2D(inRTT, uv);
-
- // Get luminence value
- vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
-
- // tone map this
- vec4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
-
- // Get bloom colour
- vec4 bloom = texture2D(inBloom, uv);
-
- // Add scene & bloom
- gl_FragColor = vec4(toneMappedSceneCol.rgb + bloom.rgb, 1.0);
-
-}
-
Deleted: data/branches/Shader_HS18/programs/hdr_tonemap_util.glsl
===================================================================
--- data/branches/Shader_HS18/programs/hdr_tonemap_util.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/hdr_tonemap_util.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,29 +0,0 @@
-const float MIDDLE_GREY = 0.72;
-const float FUDGE = 0.001;
-const float L_WHITE = 1.5;
-
-/** Tone mapping function
- at note Only affects rgb, not a
- at param inColour The HDR colour
- at param lum The scene lumninence
- at returns Tone mapped colour
-*/
-vec4 toneMap(in vec4 inColour, in float lum)
-{
- // From Reinhard et al
- // "Photographic Tone Reproduction for Digital Images"
-
- // Initial luminence scaling (equation 2)
- inColour.rgb *= MIDDLE_GREY / (FUDGE + lum);
-
- // Control white out (equation 4 nom)
- inColour.rgb *= (1.0 + inColour.rgb / L_WHITE);
-
- // Final mapping (equation 4 denom)
- inColour.rgb /= (1.0 + inColour.rgb);
-
- return inColour;
-
-}
-
-
Deleted: data/branches/Shader_HS18/programs/ps_glow.cg
===================================================================
--- data/branches/Shader_HS18/programs/ps_glow.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/ps_glow.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,26 +0,0 @@
-struct vertexOut
-{
- float4 position : POSITION;
- float2 uv : TEXCOORD0;
- float3 worldNormal : TEXCOORD1;
- float3 worldView : TEXCOORD2;
-};
-
-float4 main(vertexOut input, uniform float alphaValue, uniform float cutoffAngle, uniform float exponent, uniform float time, uniform float4 color) : COLOR
-{
- float3 Nn = normalize(input.worldNormal);
- float3 Vn = normalize(input.worldView);
- float alphaMod = dot(Nn, Vn);//this is a measure for how close we are to the edge of a model according to our view
- float cutoff=cos(cutoffAngle * 3.14 / 180.0);//pi divided by 180
- if(alphaMod<cutoff)//transform output range so it only affects angles close to 90 degrees
- {
- alphaMod/=cutoff;
- }
- else
- {
- alphaMod=1.0;
- }
- alphaMod = pow(alphaMod,exponent); //how fast should the intensity of the glow decrease
- color.w = alphaMod * alphaValue * ((sin(time)/3.14 + 1.0) / 2.0 + 0.1);
- return color;
-}
\ No newline at end of file
Deleted: data/branches/Shader_HS18/programs/skinningTwoWeightsShadowCasterVp.glsl
===================================================================
--- data/branches/Shader_HS18/programs/skinningTwoWeightsShadowCasterVp.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/skinningTwoWeightsShadowCasterVp.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,40 +0,0 @@
-// Example GLSL program for skinning with two bone weights per vertex
-
-attribute vec4 blendIndices;
-attribute vec4 blendWeights;
-
-// 3x4 matrix, passed as vec4's for compatibility with GL 2.0
-// GL 2.0 supports 3x4 matrices
-// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing
-uniform vec4 worldMatrix3x4Array[72];
-uniform mat4 viewProjectionMatrix;
-uniform vec4 ambient;
-
-void main()
-{
- vec3 blendPos = vec3(0,0,0);
-
- for (int bone = 0; bone < 2; ++bone)
- {
- // perform matrix multiplication manually since no 3x4 matrices
- // ATI GLSL compiler can't handle indexing an array within an array so calculate the inner index first
- int idx = int(blendIndices[bone]) * 3;
- // ATI GLSL compiler can't handle unrolling the loop so do it manually
- // ATI GLSL has better performance when mat4 is used rather than using individual dot product
- // There is a bug in ATI mat4 constructor (Cat 7.2) when indexed uniform array elements are used as vec4 parameter so manually assign
- mat4 worldMatrix;
- worldMatrix[0] = worldMatrix3x4Array[idx];
- worldMatrix[1] = worldMatrix3x4Array[idx + 1];
- worldMatrix[2] = worldMatrix3x4Array[idx + 2];
- worldMatrix[3] = vec4(0);
- // now weight this into final
- blendPos += (gl_Vertex * worldMatrix).xyz * blendWeights[bone];
- }
-
- // apply view / projection to position
- gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
-
- gl_FrontSecondaryColor = vec4(0,0,0,0);
- gl_FrontColor = ambient;
- gl_TexCoord[0] = gl_MultiTexCoord0;
-}
Deleted: data/branches/Shader_HS18/programs/skinningTwoWeightsVp.glsl
===================================================================
--- data/branches/Shader_HS18/programs/skinningTwoWeightsVp.glsl 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/skinningTwoWeightsVp.glsl 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,57 +0,0 @@
-// Example GLSL program for skinning with two bone weights per vertex
-
-attribute vec4 blendIndices;
-attribute vec4 blendWeights;
-
-// 3x4 matrix, passed as vec4's for compatibility with GL 2.0
-// GL 2.0 supports 3x4 matrices
-// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing
-uniform vec4 worldMatrix3x4Array[72];
-uniform mat4 viewProjectionMatrix;
-uniform vec4 lightPos[2];
-uniform vec4 lightDiffuseColour[2];
-
-void main()
-{
- vec3 blendPos = vec3(0,0,0);
- vec3 blendNorm = vec3(0,0,0);
-
- for (int bone = 0; bone < 2; ++bone)
- {
- // perform matrix multiplication manually since no 3x4 matrices
- // ATI GLSL compiler can't handle indexing an array within an array so calculate the inner index first
- int idx = int(blendIndices[bone]) * 3;
- // ATI GLSL compiler can't handle unrolling the loop so do it manually
- // ATI GLSL has better performance when mat4 is used rather than using individual dot product
- // There is a bug in ATI mat4 constructor (Cat 7.2) when indexed uniform array elements are used as vec4 parameter so manually assign
- mat4 worldMatrix;
- worldMatrix[0] = worldMatrix3x4Array[idx];
- worldMatrix[1] = worldMatrix3x4Array[idx + 1];
- worldMatrix[2] = worldMatrix3x4Array[idx + 2];
- worldMatrix[3] = vec4(0);
- // now weight this into final
- float weight = blendWeights[bone];
- blendPos += (gl_Vertex * worldMatrix).xyz * weight;
-
- mat3 worldRotMatrix = mat3(worldMatrix[0].xyz, worldMatrix[1].xyz, worldMatrix[2].xyz);
- blendNorm += (gl_Normal * worldRotMatrix) * weight;
-
- }
-
- // apply view / projection to position
- gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
-
- // simple vertex lighting model
- vec3 lightDir0 = normalize(
- lightPos[0].xyz - (blendPos.xyz * lightPos[0].w));
- vec3 lightDir1 = normalize(
- lightPos[1].xyz - (blendPos.xyz * lightPos[1].w));
-
- gl_FrontSecondaryColor = vec4(0);
- gl_FrontColor = vec4(0.5, 0.5, 0.5, 1.0)
- + clamp(dot(lightDir0, blendNorm), 0.0, 1.0) * lightDiffuseColour[0]
- + clamp(dot(lightDir1, blendNorm), 0.0, 1.0) * lightDiffuseColour[1];
-
- gl_TexCoord[0] = gl_MultiTexCoord0;
-
-}
Deleted: data/branches/Shader_HS18/programs/vs_glow.cg
===================================================================
--- data/branches/Shader_HS18/programs/vs_glow.cg 2018-11-07 09:49:23 UTC (rev 12083)
+++ data/branches/Shader_HS18/programs/vs_glow.cg 2018-11-07 09:51:06 UTC (rev 12084)
@@ -1,28 +0,0 @@
-struct vertexIn
-{
- float4 position : POSITION;
- float4 normal : NORMAL;
- float2 uv : TEXCOORD0;
-};
-
-struct vertexOut
-{
- float4 position : POSITION; //<! transformed position
- float2 uv : TEXCOORD0; //<! passing on uv information
- float3 worldNormal : TEXCOORD1; //<! surface normal transformed into world
- float3 worldView : TEXCOORD2; //<! view direction transformed into world
-};
-
-vertexOut main(vertexIn input, uniform float4x4 iWorldTMatrix, uniform float4x4 iViewMatrix, uniform float4x4 worldMatrix, uniform float4x4 viewProjMatrix, uniform float inflate )
-{
- vertexOut output;
- float4 myPosition = input.position;
- output.worldNormal=mul(iWorldTMatrix, input.normal).xyz; //transforming the normal
- input.normal = normalize(float4(input.normal.xyz,0)); //normalizing the normal according to the three relevant parts
- myPosition.xyz += inflate * input.normal; //inflating the model into a bigger shape
- myPosition = mul(worldMatrix, myPosition); //transforming position into world
- output.worldView = normalize(float3(iViewMatrix[0].w, iViewMatrix[1].w, iViewMatrix[2].w) - myPosition.xyz);//view direction according to world
- output.position = mul(viewProjMatrix, myPosition); //finish transformation of the position into the projection space
- output.uv = input.uv; //passing on uv information
- return output;
-}
\ No newline at end of file
More information about the Orxonox-commit
mailing list