path trace tonemap + filter fix
This commit is contained in:
@@ -149,9 +149,12 @@ void PathTracingRenderableComponent::Compose()
|
||||
wiRenderer::GetDevice()->EventBegin("PathTracingRenderableComponent::Compose", GRAPHICSTHREAD_IMMEDIATE);
|
||||
|
||||
|
||||
wiImageEffects fx;
|
||||
wiImageEffects fx((float)wiRenderer::GetDevice()->GetScreenWidth(), (float)wiRenderer::GetDevice()->GetScreenHeight());
|
||||
fx.blendFlag = BLENDMODE_OPAQUE;
|
||||
fx.presentFullScreen = true;
|
||||
fx.quality = QUALITY_BILINEAR;
|
||||
fx.process.setToneMap(true);
|
||||
fx.setDistortionMap(wiTextureHelper::getInstance()->getBlack()); // tonemap shader uses signed distortion mask, so black = no distortion
|
||||
fx.setMaskMap(wiTextureHelper::getInstance()->getColor(wiColor::Gray));
|
||||
|
||||
wiImage::Draw(rtAccumulation.GetTexture(), fx, GRAPHICSTHREAD_IMMEDIATE);
|
||||
|
||||
|
||||
@@ -1179,12 +1179,12 @@
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)DeferredRenderableComponent.h">
|
||||
<Filter>ENGINE\Components</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\PROJECTS\WickedEngine\WickedEngine\PathTracingRenderableComponent.h">
|
||||
<Filter>ENGINE\Components</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)ShaderInterop_BVH.h">
|
||||
<Filter>ENGINE\Graphics\GPUMapping</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PathTracingRenderableComponent.h">
|
||||
<Filter>ENGINE\Components</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)LUA\lapi.c">
|
||||
@@ -2009,7 +2009,7 @@
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)DeferredRenderableComponent.cpp">
|
||||
<Filter>ENGINE\Components</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\PROJECTS\WickedEngine\WickedEngine\PathTracingRenderableComponent.cpp">
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PathTracingRenderableComponent.cpp">
|
||||
<Filter>ENGINE\Components</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -145,19 +145,13 @@ void main( uint3 DTid : SV_DispatchThreadID, uint groupIndex : SV_GroupIndex)
|
||||
|
||||
Material mat = materialBuffer[materialIndex];
|
||||
|
||||
float4 baseColor = mat.baseColor /** baseColorMap*/;
|
||||
float4 baseColor = DEGAMMA(mat.baseColor /** baseColorMap*/);
|
||||
float reflectance = mat.reflectance/* * surfaceMap.r*/;
|
||||
float metalness = mat.metalness/* * surfaceMap.g*/;
|
||||
float emissive = mat.emissive /** surfaceMap.b*/;
|
||||
float roughness = mat.roughness/* * normalMap.a*/;
|
||||
float sss = mat.subsurfaceScattering;
|
||||
|
||||
//float4 baseColor = 1;
|
||||
//float roughness = 0.2f;
|
||||
//float reflectance = 0.3f;
|
||||
//float metalness = 0;
|
||||
//float emissive = 0;
|
||||
//float sss = 0;
|
||||
Surface surface = CreateSurface(P, N, V, baseColor, roughness, reflectance, metalness, emissive, sss);
|
||||
|
||||
[loop]
|
||||
|
||||
@@ -141,7 +141,7 @@ inline float3 Shade(inout Ray ray, RayHit hit, inout float seed, in float2 pixel
|
||||
|
||||
Material mat = materialBuffer[materialIndex];
|
||||
|
||||
float4 baseColor = mat.baseColor /** baseColorMap*/;
|
||||
float4 baseColor = DEGAMMA(mat.baseColor /** baseColorMap*/);
|
||||
float reflectance = mat.reflectance/* * surfaceMap.r*/;
|
||||
float metalness = mat.metalness/* * surfaceMap.g*/;
|
||||
float3 emissive = baseColor.rgb * mat.emissive /** surfaceMap.b*/;
|
||||
|
||||
Reference in New Issue
Block a user