-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate versions of each shader are now more easily available for co…
…mpilation TODO: write up some way to share shader code and use platform-specific features
- Loading branch information
Showing
38 changed files
with
111,660 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
#----------------------------- Global Properties ----------------------------# | ||
|
||
/outputDir:bin/$(Platform) | ||
/intermediateDir:obj/$(Platform) | ||
/platform:DesktopGL | ||
/config: | ||
/profile:Reach | ||
/compress:False | ||
|
||
#-------------------------------- References --------------------------------# | ||
|
||
|
||
#---------------------------------- Content ---------------------------------# | ||
|
||
#begin watershader_opengl.fx | ||
/importer:EffectImporter | ||
/processor:EffectProcessor | ||
/processorParam:DebugMode=Auto | ||
/build:watershader_opengl.fx | ||
|
||
#begin blurshader_opengl.fx | ||
/importer:EffectImporter | ||
/processor:EffectProcessor | ||
/processorParam:DebugMode=Auto | ||
/build:blurshader_opengl.fx | ||
|
||
#begin damageshader_opengl.fx | ||
/importer:EffectImporter | ||
/processor:EffectProcessor | ||
/processorParam:DebugMode=Auto | ||
/build:damageshader_opengl.fx | ||
|
||
#begin losshader_opengl.fx | ||
/importer:EffectImporter | ||
/processor:EffectProcessor | ||
/processorParam:DebugMode=Auto | ||
/build:losshader_opengl.fx | ||
|
||
#begin utg_4.mp4 | ||
/importer:H264Importer | ||
/processor:VideoProcessor | ||
/build:utg_4.mp4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Pixel shader applies a one dimensional gaussian blur filter. | ||
// This is used twice by the bloom postprocess, first to | ||
// blur horizontally, and then again to blur vertically. | ||
|
||
sampler TextureSampler : register(s0); | ||
|
||
#define SAMPLE_COUNT 15 | ||
|
||
float2 SampleOffsets[SAMPLE_COUNT]; | ||
float SampleWeights[SAMPLE_COUNT]; | ||
|
||
|
||
float4 PixelShaderF(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 | ||
{ | ||
float4 c = 0; | ||
|
||
// Combine a number of weighted image filter taps. | ||
for (int i = 0; i < SAMPLE_COUNT; i++) | ||
{ | ||
c += tex2D(TextureSampler, texCoord + SampleOffsets[i]) * SampleWeights[i]; | ||
} | ||
|
||
return c; | ||
} | ||
|
||
|
||
technique GaussianBlur | ||
{ | ||
pass Pass1 | ||
{ | ||
PixelShader = compile ps_2_0 PixelShaderF(); | ||
} | ||
} |
Binary file modified
BIN
+139 Bytes
(100%)
Barotrauma/BarotraumaShared/Content/blurshader_opengl.xnb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Barotrauma/BarotraumaShared/Content/damageshader_opengl.fx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
Texture xTexture; | ||
sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; }; | ||
|
||
Texture xStencil; | ||
sampler StencilSampler = sampler_state { Texture = <xStencil>; }; | ||
|
||
float4 color; | ||
|
||
float aCutoff; | ||
float aMultiplier; | ||
|
||
float cCutoff; | ||
float cMultiplier; | ||
|
||
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 | ||
{ | ||
float4 c = tex2D(TextureSampler, texCoord) * color; | ||
|
||
float4 stencilColor = tex2D(StencilSampler, texCoord); | ||
|
||
float aDiff = stencilColor.a - aCutoff; | ||
|
||
clip(aDiff); | ||
|
||
float cDiff = stencilColor.a - cCutoff; | ||
|
||
return float4( | ||
lerp(stencilColor.rgb, c.rgb, clamp(cDiff * cMultiplier, 0.0f, 1.0f)), | ||
min(aDiff * aMultiplier, c.a)); | ||
} | ||
|
||
technique StencilShader | ||
{ | ||
pass Pass1 | ||
{ | ||
PixelShader = compile ps_2_0 main(); | ||
} | ||
} |
Binary file modified
BIN
-30 Bytes
(98%)
Barotrauma/BarotraumaShared/Content/damageshader_opengl.xnb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
Texture2D xTexture; | ||
sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; }; | ||
|
||
Texture2D xLosTexture; | ||
sampler LosSampler = sampler_state { Texture = <xLosTexture>; }; | ||
|
||
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 | ||
{ | ||
float4 losColor = tex2D(LosSampler, texCoord); | ||
float4 sample = tex2D(TextureSampler, texCoord); | ||
|
||
float4 outColor = float4(sample.x*losColor.x, sample.y*losColor.x, sample.z*losColor.x, losColor.x); | ||
|
||
return outColor; | ||
} | ||
|
||
technique LosShader | ||
{ | ||
pass Pass1 | ||
{ | ||
PixelShader = compile ps_2_0 main(); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
float xBlurDistance; | ||
|
||
Texture xTexture; | ||
sampler TextureSampler = sampler_state { Texture = <xTexture>; }; | ||
|
||
Texture xWaterBumpMap; | ||
sampler WaterBumpSampler = | ||
sampler_state | ||
{ | ||
Texture = <xWaterBumpMap>; | ||
MagFilter = LINEAR; | ||
MinFilter = LINEAR; | ||
MipFilter = LINEAR; | ||
AddressU = WRAP; | ||
AddressV = WRAP; | ||
}; | ||
|
||
float xWaveWidth; | ||
float xWaveHeight; | ||
float2 xWavePos; | ||
float2 xBumpPos; | ||
|
||
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 | ||
{ | ||
float4 bumpColor = tex2D(WaterBumpSampler, texCoord+xWavePos+xBumpPos); | ||
bumpColor = (bumpColor + tex2D(WaterBumpSampler, texCoord-xWavePos*2.0f+xBumpPos))*0.5f; | ||
|
||
float2 samplePos = texCoord; | ||
|
||
samplePos.x+=(bumpColor.r-0.5f)*xWaveWidth; | ||
samplePos.y+=(bumpColor.g-0.5f)*xWaveHeight; | ||
|
||
float4 sample; | ||
sample = tex2D( TextureSampler, float2(samplePos.x+xBlurDistance, samplePos.y+xBlurDistance)); | ||
sample += tex2D( TextureSampler, float2(samplePos.x-xBlurDistance, samplePos.y-xBlurDistance)); | ||
sample += tex2D( TextureSampler, float2(samplePos.x+xBlurDistance, samplePos.y-xBlurDistance)); | ||
sample += tex2D( TextureSampler, float2(samplePos.x-xBlurDistance, samplePos.y+xBlurDistance)); | ||
|
||
sample = sample * 0.25; | ||
|
||
return sample; | ||
} | ||
|
||
technique WaterShader | ||
{ | ||
pass Pass1 | ||
{ | ||
PixelShader = compile ps_2_0 main(); | ||
} | ||
} |
Binary file modified
BIN
-301 Bytes
(86%)
Barotrauma/BarotraumaShared/Content/watershader_opengl.xnb
Binary file not shown.
Binary file added
BIN
+336 KB
Libraries/Farseer Physics Engine 3.5/DebugWindows/FarseerPhysics MonoGame.dll
Binary file not shown.
Binary file added
BIN
+954 KB
Libraries/Farseer Physics Engine 3.5/DebugWindows/FarseerPhysics MonoGame.pdb
Binary file not shown.
Binary file added
BIN
+785 KB
Libraries/Farseer Physics Engine 3.5/DebugWindows/MonoGame.Framework.dll
Binary file not shown.
Oops, something went wrong.