-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed shadows, the depth pass saga is completed(2d skybox added)
- Loading branch information
Showing
5 changed files
with
64 additions
and
13 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
const char depthpass_lua[] = "\n""local depthWriteMat = CreateMaterial( \"egsm/depthmat\", \"DepthWrite\", {\n""\n"" [\"$no_fullbright\"] = \"1\",\n""\n"" [\"$color_depth\"] = \"1\",\n""\n"" [\"$alpha_test\"] = \"0\",\n""\n""} )\n""\n""\n""local bDepthPass = false\n""\n""local halo = {}\n""\n""local render = render\n""\n""\n""MaterialOverride = MaterialOverride or render.MaterialOverride\n""\n""BrushMaterialOverride = BrushMaterialOverride or render.BrushMaterialOverride \n""\n""WorldMaterialOverride = WorldMaterialOverride or render.WorldMaterialOverride \n""\n""ModelMaterialOverride = ModelMaterialOverride or render.ModelMaterialOverride \n""\n""\n""local MaterialOverride = MaterialOverride\n""\n""local BrushMaterialOverride = BrushMaterialOverride\n""\n""local WorldMaterialOverride = WorldMaterialOverride\n""\n""local ModelMaterialOverride = ModelMaterialOverride\n""\n""\n""function render.MaterialOverride(m)\n""\n"" if bDepthPass then return end\n""\n"" MaterialOverride(m)\n""\n""end\n""\n""\n""function render.BrushMaterialOverride(m)\n""\n"" if bDepthPass then return end\n""\n"" BrushMaterialOverride(m)\n""\n""end\n""\n""\n""function render.WorldMaterialOverride(m)\n""\n"" if bDepthPass then return end\n""\n"" WorldMaterialOverride(m)\n""\n""end\n""\n""function render.ModelMaterialOverride(m)\n""\n"" if bDepthPass then return end\n""\n"" ModelMaterialOverride(m)\n""\n""end\n""\n""\n""local function dummyFn() end\n""\n""\n""local PushRenderTarget = render.PushRenderTarget\n""\n""local PopRenderTarget = render.PopRenderTarget\n""\n""local rClear = render.Clear\n""\n""local depthRT = render.GetResolvedFullFrameDepth()\n""\n""local hRender = dummyFn\n""\n""local BeginDepthPass = shaderlib.BeginDepthPass\n""\n""local EndDepthPass = shaderlib.EndDepthPass\n""\n""\n""local function PreDrawEffectsHK() \n""\n"" if bDepthPass then return end\n""\n"" bDepthPass = true\n""\n"" halo.Render = dummyFn\n""\n"" \n""\n"" MaterialOverride( depthWriteMat )\n""\n"" BrushMaterialOverride( depthWriteMat )\n""\n"" WorldMaterialOverride( depthWriteMat )\n""\n"" ModelMaterialOverride( depthWriteMat )\n""\n"" \n""\n"" BeginDepthPass()\n""\n"" rClear(0,0,0,0) \n""\n"" PopRenderTarget()\n""\n"" \n""\n"" rClear(0,0,0,0)\n""\n"" PopRenderTarget()\n""\n"" \n""\n"" rClear(0,0,0,0) \n""\n"" render.RenderView()\n""\n"" EndDepthPass()\n""\n""\n""\n"" MaterialOverride()\n""\n"" BrushMaterialOverride()\n""\n"" WorldMaterialOverride()\n""\n"" ModelMaterialOverride()\n""\n"" \n""\n"" halo.Render = hRender\n""\n"" bDepthPass = false\n""\n""end\n""\n""\n""local rClearDepth = render.ClearDepth\n""\n""\n""\n""\n""function shaderlib.__INIT()\n""\n"" halo = halo\n""\n"" hRender = halo.Render\n""\n""\n"" hook.Add(\"PreDrawViewModel\", \"!!!EGSM_ImTooLazy\", function() if bDepthPass then rClearDepth() end end)\n""\n"" hook.Add( \"RenderScene\", \"!!!EGSM_ImTooLazy\", PreDrawEffectsHK)\n""\n""end\n""\n""\n"; | ||
const char depthpass_lua[] = "\n""local depthWriteMat = CreateMaterial( \"egsm/depthmat\", \"DepthWrite\", {\n""\n"" [\"$no_fullbright\"] = \"1\",\n""\n"" [\"$color_depth\"] = \"1\",\n""\n"" [\"$alpha_test\"] = \"0\",\n""\n""} )\n""\n""\n""local bDepthPass = false\n""\n""local halo = {}\n""\n""local render = render\n""\n""\n""MaterialOverride = MaterialOverride or render.MaterialOverride\n""\n""BrushMaterialOverride = BrushMaterialOverride or render.BrushMaterialOverride \n""\n""WorldMaterialOverride = WorldMaterialOverride or render.WorldMaterialOverride \n""\n""ModelMaterialOverride = ModelMaterialOverride or render.ModelMaterialOverride \n""\n""\n""local MaterialOverride = MaterialOverride\n""\n""local BrushMaterialOverride = BrushMaterialOverride\n""\n""local WorldMaterialOverride = WorldMaterialOverride\n""\n""local ModelMaterialOverride = ModelMaterialOverride\n""\n""\n""function render.MaterialOverride(m)\n""\n"" if bDepthPass then return end\n""\n"" MaterialOverride(m)\n""\n""end\n""\n""\n""function render.BrushMaterialOverride(m)\n""\n"" if bDepthPass then return end\n""\n"" BrushMaterialOverride(m)\n""\n""end\n""\n""\n""function render.WorldMaterialOverride(m)\n""\n"" if bDepthPass then return end\n""\n"" WorldMaterialOverride(m)\n""\n""end\n""\n""function render.ModelMaterialOverride(m)\n""\n"" if bDepthPass then return end\n""\n"" ModelMaterialOverride(m)\n""\n""end\n""\n""\n""local function dummyFn() end\n""\n""\n""local PushRenderTarget = render.PushRenderTarget\n""\n""local PopRenderTarget = render.PopRenderTarget\n""\n""local rClear = render.Clear\n""\n""local depthRT = render.GetResolvedFullFrameDepth()\n""\n""local hRender = dummyFn\n""\n""local BeginDepthPass = shaderlib.BeginDepthPass\n""\n""local EndDepthPass = shaderlib.EndDepthPass\n""\n""local RenderView = render.RenderView\n""\n""local rClearDepth = render.ClearDepth\n""\n""\n""local function PreDrawEffectsHK() \n""\n"" if bDepthPass then return end\n""\n"" bDepthPass = true\n""\n"" \n""\n"" halo.Render = dummyFn\n""\n"" \n""\n"" MaterialOverride( depthWriteMat )\n""\n"" BrushMaterialOverride( depthWriteMat )\n""\n"" WorldMaterialOverride( depthWriteMat )\n""\n"" ModelMaterialOverride( depthWriteMat )\n""\n"" \n""\n"" BeginDepthPass()\n""\n"" rClear(0,0,0,0) \n""\n"" PopRenderTarget()\n""\n"" \n""\n"" rClear(0,0,0,0)\n""\n"" PopRenderTarget()\n""\n"" \n""\n"" rClear(0,0,0,0) \n""\n""\n"" RenderView()\n""\n"" EndDepthPass()\n""\n""\n"" MaterialOverride()\n""\n"" BrushMaterialOverride()\n""\n"" WorldMaterialOverride()\n""\n"" ModelMaterialOverride()\n""\n"" \n""\n"" halo.Render = hRender\n""\n"" bDepthPass = false\n""\n""end\n""\n""\n""local zero_vec = Vector(0,0,0)\n""\n""local min,max = zero_vec, zero_vec\n""\n""\n""function shaderlib.__INIT()\n""\n"" halo = halo\n""\n"" hRender = halo.Render\n""\n""\n"" hook.Add(\"PreDrawViewModel\", \"!!!EGSM_ImTooLazy\", function() if bDepthPass then rClearDepth() end end) \n""\n"" hook.Add(\"NeedsDepthPass\", \"!!!EGSM_ImTooLazy\", PreDrawEffectsHK)\n""\n"" \n""\n"" hook.Add(\"PostDraw2DSkyBox\", \"!!!EGSM_ImTooLazy\", function()\n""\n"" local rt = render.GetRenderTarget()\n""\n"" if !rt or rt:GetName() != \"egsm_skyboxrt\" \n""\n"" then \n""\n"" return\n""\n"" end\n""\n"" cam.Start3D( zero_vec, EyeAngles() )\n""\n"" min,max = game.GetWorld():GetModelBounds()\n""\n"" \n""\n"" render.SetMaterial( depthWriteMat )\n""\n"" \n""\n"" render.DrawBox( zero_vec, angle_zero, max, min, color_white )\n""\n"" cam.End3D()\n""\n"" end) \n""\n""end\n""\n""\n"; |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
#define EGSM_VERSION 10 | ||
#define EGSM_VERSION 11 |