mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-08-20 08:59:21 +08:00
Slightly improved water for deferred shading by enabling depth write
This commit is contained in:
parent
4e987e523a
commit
458e9d365e
@ -521,21 +521,8 @@ namespace CodeWalker.Rendering
|
|||||||
|
|
||||||
context.OutputMerger.BlendState = bsDefault;
|
context.OutputMerger.BlendState = bsDefault;
|
||||||
context.Rasterizer.State = wireframe ? rsWireframeDblSided : rsSolidDblSided;
|
context.Rasterizer.State = wireframe ? rsWireframeDblSided : rsSolidDblSided;
|
||||||
context.OutputMerger.DepthStencilState = dsDisableWrite;
|
context.OutputMerger.DepthStencilState = dsEnabled;
|
||||||
|
if (RenderWaterQuads.Count > 0) //render water quads
|
||||||
for (int i = 0; i < RenderBuckets.Count; i++) //water pass
|
|
||||||
{
|
|
||||||
var bucket = RenderBuckets[i];
|
|
||||||
if (bucket.WaterBatches.Count > 0)
|
|
||||||
{
|
|
||||||
RenderGeometryBatches(context, bucket.WaterBatches, Water);
|
|
||||||
}
|
|
||||||
if (bucket.Water2Batches.Count > 0)
|
|
||||||
{
|
|
||||||
RenderGeometryBatches(context, bucket.Water2Batches, Water);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (RenderWaterQuads.Count > 0) //also render water quads here
|
|
||||||
{
|
{
|
||||||
Water.SetShader(context);
|
Water.SetShader(context);
|
||||||
Water.SetSceneVars(context, Camera, Shadowmap, GlobalLights);
|
Water.SetSceneVars(context, Camera, Shadowmap, GlobalLights);
|
||||||
@ -545,6 +532,24 @@ namespace CodeWalker.Rendering
|
|||||||
}
|
}
|
||||||
Water.UnbindResources(context);
|
Water.UnbindResources(context);
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < RenderBuckets.Count; i++) //main water geoms pass
|
||||||
|
{
|
||||||
|
var bucket = RenderBuckets[i];
|
||||||
|
if (bucket.WaterBatches.Count > 0)
|
||||||
|
{
|
||||||
|
RenderGeometryBatches(context, bucket.WaterBatches, Water);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
context.OutputMerger.DepthStencilState = dsDisableWrite;
|
||||||
|
for (int i = 0; i < RenderBuckets.Count; i++) //water decals pass
|
||||||
|
{
|
||||||
|
var bucket = RenderBuckets[i];
|
||||||
|
if (bucket.Water2Batches.Count > 0)
|
||||||
|
{
|
||||||
|
RenderGeometryBatches(context, bucket.Water2Batches, Water);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user