Jelajahi Sumber

Fixed GUI shaders so elements render in proper order

Marko Pintera 12 tahun lalu
induk
melakukan
33a24c8069

+ 15 - 0
BansheeEngine/Source/BsD3D11BuiltinMaterialFactory.cpp

@@ -6,6 +6,7 @@
 #include "CmPass.h"
 #include "CmMaterial.h"
 #include "CmBlendState.h"
+#include "CmDepthStencilState.h"
 
 using namespace CamelotFramework;
 
@@ -119,6 +120,13 @@ namespace BansheeEngine
 
 		HBlendState blendState = BlendState::create(desc);
 		newPass->setBlendState(blendState);
+
+		DEPTH_STENCIL_STATE_DESC depthStateDesc;
+		depthStateDesc.depthReadEnable = false;
+		depthStateDesc.depthWriteEnable = false;
+
+		HDepthStencilState depthState = DepthStencilState::create(depthStateDesc);
+		newPass->setDepthStencilState(depthState);
 	}
 
 	void D3D11BuiltinMaterialFactory::initSpriteImageShader()
@@ -181,6 +189,13 @@ namespace BansheeEngine
 
 		HBlendState blendState = BlendState::create(desc);
 		newPass->setBlendState(blendState);
+
+		DEPTH_STENCIL_STATE_DESC depthStateDesc;
+		depthStateDesc.depthReadEnable = false;
+		depthStateDesc.depthWriteEnable = false;
+
+		HDepthStencilState depthState = DepthStencilState::create(depthStateDesc);
+		newPass->setDepthStencilState(depthState);
 	}
 
 	void D3D11BuiltinMaterialFactory::initDebugDrawShader()

+ 15 - 0
BansheeEngine/Source/BsD3D9BuiltinMaterialFactory.cpp

@@ -5,6 +5,7 @@
 #include "CmPass.h"
 #include "CmMaterial.h"
 #include "CmBlendState.h"
+#include "CmDepthStencilState.h"
 #include "CmRendererManager.h"
 
 using namespace CamelotFramework;
@@ -118,6 +119,13 @@ namespace BansheeEngine
 
 		HBlendState blendState = BlendState::create(desc);
 		newPass->setBlendState(blendState);
+
+		DEPTH_STENCIL_STATE_DESC depthStateDesc;
+		depthStateDesc.depthReadEnable = false;
+		depthStateDesc.depthWriteEnable = false;
+
+		HDepthStencilState depthState = DepthStencilState::create(depthStateDesc);
+		newPass->setDepthStencilState(depthState);
 	}
 
 	void D3D9BuiltinMaterialFactory::initSpriteImageShader()
@@ -179,6 +187,13 @@ namespace BansheeEngine
 
 		HBlendState blendState = BlendState::create(desc);
 		newPass->setBlendState(blendState);
+
+		DEPTH_STENCIL_STATE_DESC depthStateDesc;
+		depthStateDesc.depthReadEnable = false;
+		depthStateDesc.depthWriteEnable = false;
+
+		HDepthStencilState depthState = DepthStencilState::create(depthStateDesc);
+		newPass->setDepthStencilState(depthState);
 	}
 
 	void D3D9BuiltinMaterialFactory::initDebugDrawShader()

+ 15 - 0
BansheeEngine/Source/BsGLBuiltinMaterialFactory.cpp

@@ -5,6 +5,7 @@
 #include "CmPass.h"
 #include "CmMaterial.h"
 #include "CmBlendState.h"
+#include "CmDepthStencilState.h"
 #include "CmRendererManager.h"
 
 using namespace CamelotFramework;
@@ -121,6 +122,13 @@ namespace BansheeEngine
 
 		HBlendState blendState = BlendState::create(desc);
 		newPass->setBlendState(blendState);
+
+		DEPTH_STENCIL_STATE_DESC depthStateDesc;
+		depthStateDesc.depthReadEnable = false;
+		depthStateDesc.depthWriteEnable = false;
+
+		HDepthStencilState depthState = DepthStencilState::create(depthStateDesc);
+		newPass->setDepthStencilState(depthState);
 	}
 
 	void GLBuiltinMaterialFactory::initSpriteImageShader()
@@ -185,6 +193,13 @@ namespace BansheeEngine
 
 		HBlendState blendState = BlendState::create(desc);
 		newPass->setBlendState(blendState);
+
+		DEPTH_STENCIL_STATE_DESC depthStateDesc;
+		depthStateDesc.depthReadEnable = false;
+		depthStateDesc.depthWriteEnable = false;
+
+		HDepthStencilState depthState = DepthStencilState::create(depthStateDesc);
+		newPass->setDepthStencilState(depthState);
 	}
 
 	void GLBuiltinMaterialFactory::initDebugDrawShader()