Sfoglia il codice sorgente

Fixed 14-shadowvolumes depth texture flag to be buffer only.

Branimir Karadžić 11 anni fa
parent
commit
beb73905d0
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      examples/14-shadowvolumes/shadowvolumes.cpp

+ 3 - 3
examples/14-shadowvolumes/shadowvolumes.cpp

@@ -1999,7 +1999,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 	bgfx::TextureHandle fbtextures[] =
 	{
 		bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_RT),
-		bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::D16),
+		bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY),
 	};
 	s_stencilFb  = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
 
@@ -2130,7 +2130,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 	bool settings_updateLights       = true;
 	bool settings_updateScene        = true;
 	bool settings_mixedSvImpl        = true;
-	bool settings_useStencilTexture  = true;
+	bool settings_useStencilTexture  = false;
 	bool settings_drawShadowVolumes  = false;
 	float settings_numLights         = 1.0f;
 	float settings_instanceCount     = 9.0f;
@@ -2194,7 +2194,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 			bgfx::destroyFrameBuffer(s_stencilFb);
 
 			fbtextures[0] = bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP|BGFX_TEXTURE_RT);
-			fbtextures[1] = bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::D16);
+			fbtextures[1] = bgfx::createTexture2D(viewState.m_width, viewState.m_height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY);
 			s_stencilFb = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
 		}