It seems we forget to transform the object space normal or tangent to world space for SPIRV version
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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