NVIDIA-RTX / NVIDIA-RTX/RTXDI

It seems we forget to transform the object space normal or tangent to world space for SPIRV version

Open
#30 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HLSL
Stars
545
Forks
100
Avg merge
14d 6h
Merged PRs (30d)
1

Description

The following code is from ps_main of RasterizedGBuffer.hlsl

#ifdef SPIRV
    GeometrySample gs = (GeometrySample)0;
    gs.instance = t_InstanceData[g_Instance.instance];
    gs.geometry = t_GeometryData[gs.instance.firstGeometryIndex + g_Instance.geometryIndex];
    gs.material = t_MaterialConstants[gs.geometry.materialIndex];

    gs.texcoord = i_texcoord;
    gs.objectSpacePosition = i_objectPos;
    gs.prevObjectSpacePosition = i_prevObjectPos;
    gs.geometryNormal = normalize(i_normal);
    gs.tangent.xyz = normalize(i_tangent.xyz);
    gs.tangent.w = i_tangent.w;
#else
    GeometrySample gs = getGeometryFromHit(g_Instance.instance, g_Instance.geometryIndex, i_primitiveID, i_bary.yz,
        GeomAttr_All, t_InstanceData, t_GeometryData, t_MaterialConstants);
#endif

Within the getGeometryFromHit, we transform the normal and tangent from object space to world space. But for SPIRV version, we keep using the object space normal and tangent.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the ps_main code path of RasterizedGBuffer.hlsl and compare the SPIRV branch with getGeometryFromHit. Trace how the non-SPIRV path transforms the normal and tangent from object space to world space, then verify that the SPIRV path produces the same spaces for both values. Done means the SPIRV version no longer retains object-space normals or tangents.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.