Trying to add opacity

This commit is contained in:
Dynamitos
2024-07-16 16:44:56 +02:00
parent 60e74f87b8
commit f55a2a03d2
7 changed files with 47 additions and 14 deletions
+3 -1
View File
@@ -39,7 +39,7 @@ void closestHit(inout RayPayload hitValue, in BuiltInTriangleIntersectionAttribu
LightingParameter lightingParams = params.getLightingParameter();
MaterialParameter materialParams = params.getMaterialParameter();
let brdf = Material.prepare(materialParams);
float3 result = float3(0, 0, 0);
for(int i = 0; i < pLightEnv.numDirectionalLights; ++i)
{
@@ -53,5 +53,7 @@ void closestHit(inout RayPayload hitValue, in BuiltInTriangleIntersectionAttribu
// gamma correction
result = result / (result + float3(1.0));
result = pow(result, float3(1.0/2.2));
hitValue.color = result;
}
+1
View File
@@ -19,6 +19,7 @@ void raygen()
rayDesc.TMax = 10000.0;
RayPayload payload;
payload.rayDirection = rayDesc.Direction;
TraceRay(pRayTracingParams.scene, RAY_FLAG_FORCE_OPAQUE, 0xff, 0, 0, 0, rayDesc, payload);
pRayTracingParams.image[int2(LaunchID.xy)] = float4(payload.color, 1.0);
@@ -17,5 +17,6 @@ struct CallablePayload
struct RayPayload
{
float3 rayDirection;
float3 color;
};