Skip to content

Comments

Hlsl path tracer#224

Open
devshgraphicsprogramming wants to merge 186 commits intomasterfrom
hlsl_path_tracer
Open

Hlsl path tracer#224
devshgraphicsprogramming wants to merge 186 commits intomasterfrom
hlsl_path_tracer

Conversation

@devshgraphicsprogramming
Copy link
Member

@devshgraphicsprogramming devshgraphicsprogramming commented Nov 3, 2025

@keptsecret after you merge master again, you'll probably have the UI mess up and show changed from the merge commit, so close and reopen again

TODO

  • 4 unresolved conversations from RWMC #218, check if done

Comment on lines 119 to 136
Shape<float, PST_SPHERE>::create(float3(-1.5, 1.5, 0.0), 0.3, bxdfnode_type::INVALID_ID, 0u)
Shape<float, PST_SPHERE>::create(float3(-1.5, 1.5, 0.0), 0.3, 9u, 0u)
};
#endif

#ifdef TRIANGLE_LIGHT
static const Shape<float, PST_TRIANGLE> triangles[scene_type::SCENE_LIGHT_COUNT] = {
Shape<float, PST_TRIANGLE>::create(float3(-1.8,0.35,0.3) * 10.0, float3(-1.2,0.35,0.0) * 10.0, float3(-1.5,0.8,-0.3) * 10.0, bxdfnode_type::INVALID_ID, 0u)
Shape<float, PST_TRIANGLE>::create(float3(-1.8,0.35,0.3) * 10.0, float3(-1.2,0.35,0.0) * 10.0, float3(-1.5,0.8,-0.3) * 10.0, 9u, 0u)
};
#endif

#ifdef RECTANGLE_LIGHT
static const Shape<float, PST_RECTANGLE> rectangles[scene_type::SCENE_LIGHT_COUNT] = {
Shape<float, PST_RECTANGLE>::create(float3(-3.8,0.35,1.3), normalize(float3(2,0,-1))*7.0, normalize(float3(2,-5,4))*0.1, bxdfnode_type::INVALID_ID, 0u)
Shape<float, PST_RECTANGLE>::create(float3(-3.8,0.35,1.3), normalize(float3(2,0,-1))*7.0, normalize(float3(2,-5,4))*0.1, 9u, 0u)
};
#endif

static const light_type lights[scene_type::SCENE_LIGHT_COUNT] = {
light_type::create(LightEminence,
light_type::create(9u,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have you gone from nice semantic enums to nast literals like 9u with no meaning for the bxdf?

}
};

enum MaterialType : uint32_t // enum class?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum class introduces issues to DXC unfortunately

Comment on lines 62 to 63
uint32_t id;
uint32_t mode;
ProceduralShapeType shapeType;
uint32_t mode : 2u;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you not fit the id in 12 bits and make everything a uint16_t ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also what's mode ?

Comment on lines 1126 to 1133
const float rcpLog2Base = 1.0f / std::log2(guiControlled.rwmcParams.base);
const float baseRootOfStart = std::exp2(std::log2(guiControlled.rwmcParams.start) * rcpLog2Base);
const float log2BaseRootOfStart = std::log2(baseRootOfStart);
const float brightSampleLumaBias = (log2BaseRootOfStart + static_cast<float>(CascadeCount - 1u)) / rcpLog2Base;
float32_t2 packLogs = float32_t2(baseRootOfStart, rcpLog2Base);
float32_t2 packPrecomputed = float32_t2(log2BaseRootOfStart, brightSampleLumaBias);
rwmcPushConstants.splattingParameters.PackedBaseRootAndRcpLog2Base = hlsl::packHalf2x16(packLogs);
rwmcPushConstants.splattingParameters.PackedLog2BaseRootAndBrightSampleLumaBias = hlsl::packHalf2x16(packPrecomputed);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't this a nice HLSL create of the packed splatting parameters?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was before merging rwmc fix. Seems I'll have to change it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants