From c4085096a1f5577952063a765b20ebc6c54fabef Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 26 Jan 2016 13:10:30 +0100 Subject: [PATCH] Merged in GZDB r2485 --- Build/Configurations/Includes/ZDoom_linedefs.cfg | 2 +- Source/Core/Rendering/D3DShader.cs | 7 +++++-- Source/Core/Resources/world3d.fx | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Build/Configurations/Includes/ZDoom_linedefs.cfg b/Build/Configurations/Includes/ZDoom_linedefs.cfg index ddc16fb..ed6e721 100644 --- a/Build/Configurations/Includes/ZDoom_linedefs.cfg +++ b/Build/Configurations/Includes/ZDoom_linedefs.cfg @@ -3324,7 +3324,7 @@ zdoom } arg3 { - title = "Alpha"; + title = "Opacity"; default = 255; } } diff --git a/Source/Core/Rendering/D3DShader.cs b/Source/Core/Rendering/D3DShader.cs index 5c5b6a0..6f66db6 100644 --- a/Source/Core/Rendering/D3DShader.cs +++ b/Source/Core/Rendering/D3DShader.cs @@ -112,8 +112,11 @@ namespace CodeImp.DoomBuilder.Rendering // Compiling failed, try with debug information try { - // Compile effect - fx = Effect.FromStream(General.Map.Graphics.Device, fxdata, null, null, null, ShaderFlags.Debug, null, out errors); + //mxd. Rewind before use! + fxdata.Seek(0, SeekOrigin.Begin); + + // Compile effect + fx = Effect.FromStream(General.Map.Graphics.Device, fxdata, null, null, null, ShaderFlags.Debug, null, out errors); if(!string.IsNullOrEmpty(errors)) { throw new Exception("Errors in effect file " + fxfile + ": " + errors); diff --git a/Source/Core/Resources/world3d.fx b/Source/Core/Resources/world3d.fx index dca8012..d610ca3 100644 --- a/Source/Core/Resources/world3d.fx +++ b/Source/Core/Resources/world3d.fx @@ -169,7 +169,7 @@ float4 ps_fullbright(PixelData pd) : COLOR float4 ps_main_highlight(PixelData pd) : COLOR { float4 tcolor = tex2D(texturesamp, pd.uv); - if(tcolor.a == 0) clip(-1); + if(tcolor.a == 0) return tcolor; // Blend texture color and vertex color float4 ncolor = tcolor * pd.color; @@ -181,7 +181,7 @@ float4 ps_main_highlight(PixelData pd) : COLOR float4 ps_fullbright_highlight(PixelData pd) : COLOR { float4 tcolor = tex2D(texturesamp, pd.uv); - if(tcolor.a == 0) clip(-1); + if(tcolor.a == 0) return tcolor; // Blend texture color and vertex color float4 ncolor = tcolor * pd.color; @@ -204,7 +204,7 @@ float4 getFogColor(LitPixelData pd, float4 color) float4 ps_main_fog(LitPixelData pd) : COLOR { float4 tcolor = tex2D(texturesamp, pd.uv); - if(tcolor.a == 0) clip(-1); + if(tcolor.a == 0) return tcolor; return getFogColor(pd, tcolor * pd.color); } @@ -213,7 +213,7 @@ float4 ps_main_fog(LitPixelData pd) : COLOR float4 ps_main_highlight_fog(LitPixelData pd) : COLOR { float4 tcolor = tex2D(texturesamp, pd.uv); - if(tcolor.a == 0) clip(-1); + if(tcolor.a == 0) return tcolor; // Blend texture color and vertex color float4 ncolor = getFogColor(pd, tcolor * pd.color);