本文整理汇总了C#中DX11RenderSettings.PostPassAction方法的典型用法代码示例。如果您正苦于以下问题:C# DX11RenderSettings.PostPassAction方法的具体用法?C# DX11RenderSettings.PostPassAction怎么用?C# DX11RenderSettings.PostPassAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DX11RenderSettings
的用法示例。
在下文中一共展示了DX11RenderSettings.PostPassAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
//.........这里部分代码省略.........
int drawCount = doOrder ? orderedSlices.Count : this.spmax;
if (this.spmax == 0)
{
drawCount = 0;
}
for (int i = 0; i < drawCount; i++)
{
int idx = doOrder ? orderedSlices[i] : i;
if (multistate)
{
context.RenderStateStack.Push(this.FInState[idx]);
}
if (shaderdata.IsLayoutValid(idx) || settings.Geometry != null)
{
objectsettings.IterationCount = this.FIter[idx];
objectsettings.RenderStateTag = this.FInState[idx] != null ? this.FInState[idx].Tag : null;
for (int k = 0; k < objectsettings.IterationCount; k++)
{
objectsettings.IterationIndex = k;
if (settings.Geometry == null)
{
if (this.FGeometry[idx] != pg)
{
pg = this.FGeometry[idx];
objectsettings.Geometry = pg[context];
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, idx);
}
}
else
{
objectsettings.Geometry = settings.Geometry;
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, idx);
}
//Prepare settings
objectsettings.DrawCallIndex = idx;
objectsettings.WorldTransform = this.mworld[idx % this.mworldcount];
if (settings.ValidateObject(objectsettings))
{
this.varmanager.ApplyPerObject(context, shaderdata.ShaderInstance, this.objectsettings, idx);
for (int ip = 0; ip < shaderdata.PassCount;ip++)
{
shaderdata.ApplyPass(ctx, ip);
if (settings.DepthOnly) { ctx.PixelShader.Set(null); }
if (settings.PostPassAction != null) { settings.PostPassAction(context); }
objectsettings.Geometry.Draw();
shaderdata.ShaderInstance.CleanUp();
}
}
}
}
if (multistate)
{
context.RenderStateStack.Pop();
}
if (settings.PostShaderAction != null)
{
settings.PostShaderAction(context);
}
}
if (pipelineState != null)
{
pipelineState.Restore(context);
}
this.OnEndQuery(context);
}
//this.query.End();
}
if (popstate)
{
context.RenderStateStack.Pop();
}
else
{
//Since shaders can define their own states, reapply top of the stack
context.RenderStateStack.Apply();
}
if (this.FInLayer.IsConnected && this.FInEnabled[0])
{
this.FInLayer[0][context].Render(this.FInLayer.PluginIO, context, settings);
}
}
示例2: Render
//.........这里部分代码省略.........
context.RenderStateStack.Push(this.FInState[0]);
popstate = true;
}
if (!settings.PreserveShaderStages)
{
shaderdata.ResetShaderStages(ctx);
}
settings.DrawCallCount = spmax; //Set number of draw calls
this.varmanager.ApplyGlobal(shaderdata.ShaderInstance);
//IDX11Geometry drawgeom = null;
objectsettings.Geometry = null;
DX11Resource<IDX11Geometry> pg = null;
for (int i = 0; i < this.spmax; i++)
{
if (multistate)
{
context.RenderStateStack.Push(this.FInState[i]);
}
if (shaderdata.IsLayoutValid(i) || settings.Geometry != null)
{
objectsettings.IterationCount = this.FIter[i];
for (int k = 0; k < objectsettings.IterationCount; k++)
{
objectsettings.IterationIndex = k;
if (settings.Geometry == null)
{
if (this.FGeometry[i] != pg)
{
pg = this.FGeometry[i];
objectsettings.Geometry = pg[context];
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, i);
}
}
else
{
objectsettings.Geometry = settings.Geometry;
shaderdata.SetInputAssembler(ctx, objectsettings.Geometry, i);
}
//Prepare settings
objectsettings.DrawCallIndex = i;
objectsettings.WorldTransform = this.mworld[i % this.mworldcount];
if (settings.ValidateObject(objectsettings))
{
this.varmanager.ApplyPerObject(context, shaderdata.ShaderInstance, this.objectsettings, i);
shaderdata.ApplyPass(ctx);
if (settings.DepthOnly) { ctx.PixelShader.Set(null); }
if (settings.PostPassAction != null) { settings.PostPassAction(context); }
objectsettings.Geometry.Draw();
shaderdata.ShaderInstance.CleanUp();
}
}
}
if (multistate)
{
context.RenderStateStack.Pop();
}
if (settings.PostShaderAction != null)
{
settings.PostShaderAction(context);
}
}
this.OnEndQuery(context);
}
//this.query.End();
}
if (popstate)
{
context.RenderStateStack.Pop();
}
else
{
//Since shaders can define their own states, reapply top of the stack
context.RenderStateStack.Apply();
}
if (this.FInLayer.PluginIO.IsConnected && this.FInEnabled[0])
{
this.FInLayer[0][context].Render(this.FInLayer.PluginIO, context, settings);
}
}