Browse Source

Fixing a bug in Clusterer. Start using HDR for the indirect

Panagiotis Christopoulos Charitos 10 years ago
parent
commit
46f85bba08
4 changed files with 5 additions and 13 deletions
  1. 0 2
      include/anki/renderer/Ir.h
  2. 1 2
      src/renderer/Clusterer.cpp
  3. 3 8
      src/renderer/Ir.cpp
  4. 1 1
      testapp/Main.cpp

+ 0 - 2
include/anki/renderer/Ir.h

@@ -89,8 +89,6 @@ private:
 		Timestamp m_timestamp = 0; ///< When last rendered.
 	};
 
-	static const PixelFormat IRRADIANCE_RT_PIXEL_FORMAT;
-
 	Renderer m_nestedR;
 	TexturePtr m_envCubemapArr;
 	U16 m_cubemapArrMipCount = 0;

+ 1 - 2
src/renderer/Clusterer.cpp

@@ -537,11 +537,10 @@ void Clusterer::binGeneric(const CollisionShape& cs,
 void Clusterer::update(U32 threadId, PtrSize threadsCount, Bool frustumChanged)
 {
 	PtrSize start, end;
-	const MoveComponent& move = m_node->getComponent<MoveComponent>();
 	const FrustumComponent& frc = *m_frc;
 	ANKI_ASSERT(frc.getFrustum().getType() == Frustum::Type::PERSPECTIVE);
 
-	const Transform& trf = move.getWorldTransform();
+	const Transform& trf = frc.getFrustum().getTransform();
 	const Vec4& projParams = frc.getProjectionParameters();
 
 	if(frustumChanged)

+ 3 - 8
src/renderer/Ir.cpp

@@ -141,10 +141,6 @@ public:
 // Ir                                                                          =
 //==============================================================================
 
-//==============================================================================
-const PixelFormat Ir::IRRADIANCE_RT_PIXEL_FORMAT(
-	ComponentFormat::R8G8B8, TransformFormat::UNORM);
-
 //==============================================================================
 Ir::Ir(Renderer* r)
 	: RenderingPass(r)
@@ -218,7 +214,7 @@ Error Ir::init(const ConfigSet& config)
 	texinit.m_height = m_fbSize;
 	texinit.m_depth = m_cubemapArrSize;
 	texinit.m_type = TextureType::CUBE_ARRAY;
-	texinit.m_format = Pps::RT_PIXEL_FORMAT;
+	texinit.m_format = Is::RT_PIXEL_FORMAT;
 	texinit.m_mipmapsCount = MAX_U8;
 	texinit.m_samples = 1;
 	texinit.m_sampling.m_minMagFilter = SamplingFilter::LINEAR;
@@ -226,7 +222,6 @@ Error Ir::init(const ConfigSet& config)
 
 	m_envCubemapArr = getGrManager().newInstance<Texture>(texinit);
 
-	texinit.m_format = IRRADIANCE_RT_PIXEL_FORMAT;
 	m_irradianceCubemapArr = getGrManager().newInstance<Texture>(texinit);
 
 	m_cubemapArrMipCount = computeMaxMipmapCount(m_fbSize, m_fbSize);
@@ -601,7 +596,7 @@ Error Ir::renderReflection(SceneNode& node,
 		ANKI_CHECK(m_nestedR.render(node, i, cmdb));
 
 		// Copy env texture
-		cmdb->copyTextureToTexture(m_nestedR.getPps().getRt(),
+		cmdb->copyTextureToTexture(m_nestedR.getIs().getRt(),
 			0,
 			0,
 			m_envCubemapArr,
@@ -624,7 +619,7 @@ Error Ir::renderReflection(SceneNode& node,
 		fbinit.m_colorAttachments[0].m_texture = m_irradianceCubemapArr;
 		fbinit.m_colorAttachments[0].m_arrayIndex = cubemapIdx;
 		fbinit.m_colorAttachments[0].m_faceIndex = i;
-		fbinit.m_colorAttachments[0].m_format = IRRADIANCE_RT_PIXEL_FORMAT;
+		fbinit.m_colorAttachments[0].m_format = Is::RT_PIXEL_FORMAT;
 		fbinit.m_colorAttachments[0].m_loadOperation =
 			AttachmentLoadOperation::DONT_CARE;
 		FramebufferPtr fb = getGrManager().newInstance<Framebuffer>(fbinit);

+ 1 - 1
testapp/Main.cpp

@@ -502,7 +502,7 @@ Error initSubsystems(int argc, char* argv[])
 	config.set("is.sm.poissonEnabled", true);
 	config.set("is.sm.resolution", 1024);
 	config.set("lf.maxFlares", 32);
-	config.set("pps.enabled", true);
+	config.set("pps.enabled", false);
 	config.set("pps.bloom.enabled", true);
 	config.set("pps.bloom.renderingQuality", 0.5);
 	config.set("pps.bloom.blurringDist", 1.0);