Added Comments
Added ability to hold shift and skip the terrain generation when loading Added ability for the perlin terrain to save a raw image of the terrain to use as a cache
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
void SubMeshRenderer::SetRootChildren(list<SceneNodePointer>& rootChildren)
|
||||
{
|
||||
// Sets the root children since the actual sub mesh root could have multiple children...
|
||||
_rootGraph = &rootChildren;
|
||||
}
|
||||
|
||||
@ -35,8 +36,10 @@ bool SubMeshRenderer::Initialise()
|
||||
|
||||
void SubMeshRenderer::RenderChild(SceneNodePointer node, bool renderTransparent)
|
||||
{
|
||||
// Check if the current node is a sub mesh
|
||||
shared_ptr<SubMeshNode> currentMeshNode = dynamic_pointer_cast<SubMeshNode>(node);
|
||||
|
||||
// If the current node is a submesh, render it
|
||||
if (currentMeshNode != nullptr)
|
||||
{
|
||||
XMMATRIX projectionTransformation = DirectXFramework::GetDXFramework()->GetProjectionTransformation();
|
||||
@ -82,6 +85,7 @@ void SubMeshRenderer::RenderChild(SceneNodePointer node, bool renderTransparent)
|
||||
}
|
||||
}
|
||||
|
||||
// If the current node is not a sub mesh its most likely a scene graph, if so loop the children of it
|
||||
shared_ptr<SceneGraph> currentGraphNode = dynamic_pointer_cast<SceneGraph>(node);
|
||||
|
||||
if (currentGraphNode != nullptr)
|
||||
@ -118,6 +122,9 @@ void SubMeshRenderer::Render()
|
||||
float blendFactors[] = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
_deviceContext->OMSetBlendState(_transparentBlendState.Get(), blendFactors, 0xffffffff);
|
||||
|
||||
// IT REALLY NEEDS TO DO BOTH TO RENDER SOMEWHAT CORRECTLY
|
||||
// This should solve that now
|
||||
|
||||
// We do two passes through the nodes. The first time we render nodes
|
||||
// that are not transparent (i.e. their opacity == 1.0f).
|
||||
for (SceneNodePointer& child : *_rootGraph)
|
||||
|
Reference in New Issue
Block a user