本文整理汇总了C#中IRenderable.GetRenderOperation方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderable.GetRenderOperation方法的具体用法?C# IRenderable.GetRenderOperation怎么用?C# IRenderable.GetRenderOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRenderable
的用法示例。
在下文中一共展示了IRenderable.GetRenderOperation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderSingleObject
/// <summary>
/// Internal utility method for rendering a single object.
/// </summary>
/// <param name="renderable">The renderable to issue to the pipeline.</param>
/// <param name="pass">The pass which is being used.</param>
/// <param name="doLightIteration">If true, this method will issue the renderable to
/// the pipeline possibly multiple times, if the pass indicates it should be
/// done once per light.</param>
/// <param name="manualLightList">Only applicable if 'doLightIteration' is false, this
/// method allows you to pass in a previously determined set of lights
/// which will be used for a single render of this object.</param>
protected virtual void RenderSingleObject(IRenderable renderable, Pass pass,
bool doLightIteration, List<Light> manualLightList)
{
targetRenderSystem.BeginProfileEvent(ColorEx.Red, "RenderSingleObject: Material = " + renderable.Material.Name);
ushort numMatrices = 0;
// grab the current scene detail level
SceneDetailLevel camDetailLevel = cameraInProgress.SceneDetail;
// // update auto params if this is a programmable pass
// if(pass.IsProgrammable) {
// autoParamDataSource.Renderable = renderable;
// pass.UpdateAutoParamsNoLights(autoParamDataSource);
// }
// get the world matrices and the count
renderable.GetWorldTransforms(xform);
numMatrices = renderable.NumWorldTransforms;
// set the world matrices in the render system
if(numMatrices > 1) {
targetRenderSystem.SetWorldMatrices(xform, numMatrices);
}
else {
targetRenderSystem.WorldMatrix = xform[0];
}
// issue view/projection changes (if any)
UseRenderableViewProjection(renderable);
if (!suppressRenderStateChanges) {
bool passSurfaceAndLightParams = true;
if (pass.IsProgrammable) {
// Tell auto params object about the renderable change
autoParamDataSource.Renderable = renderable;
// Tell auto params object about the world matrices, eliminated query from renderable again
autoParamDataSource.SetWorldMatrices(xform, numMatrices);
pass.UpdateAutoParamsNoLights(autoParamDataSource);
if (pass.HasVertexProgram)
passSurfaceAndLightParams = pass.VertexProgram.PassSurfaceAndLightStates;
}
// issue texture units that depend on updated view matrix
// reflective env mapping is one case
for(int i = 0; i < pass.NumTextureUnitStages; i++) {
TextureUnitState texUnit = pass.GetTextureUnitState(i);
if(texUnit.HasViewRelativeTexCoordGen) {
targetRenderSystem.SetTextureUnit(i, texUnit, !pass.HasFragmentProgram);
}
}
// Normalize normals
bool thisNormalize = renderable.NormalizeNormals;
if(thisNormalize != normalizeNormals) {
targetRenderSystem.NormalizeNormals = thisNormalize;
normalizeNormals = thisNormalize;
}
// Set up the solid / wireframe override
SceneDetailLevel requestedDetail = renderable.RenderDetail;
if (requestedDetail != lastDetailLevel || requestedDetail != camDetailLevel) {
if (requestedDetail > camDetailLevel) {
// only downgrade detail; if cam says wireframe we don't go up to solid
requestedDetail = camDetailLevel;
}
targetRenderSystem.RasterizationMode = requestedDetail;
lastDetailLevel = requestedDetail;
}
// TODO: Add ClipPlanes to RenderSystem.cs
//targetRenderSystem.ClipPlanes = renderable.ClipPlanes;
// get the renderables render operation
renderable.GetRenderOperation(op);
// TODO: Add srcRenderable to RenderOperation.cs
//op.srcRenderable = renderable;
if(doLightIteration) {
// Here's where we issue the rendering operation to the render system
// Note that we may do this once per light, therefore it's in a loop
// and the light parameters are updated once per traversal through the
// loop
doLightMeter.Enter();
if (MeterManager.Collecting) {
string s = string.Format("Rendering material '{0}'", renderable.Material.Name);
//.........这里部分代码省略.........