KhronosGroup / KhronosGroup/glTF-Sample-Assets

DirectionalLight.gltf model is modeled inside out

Open
#118 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
107
Avg merge
9h 39m
Merged PRs (30d)
4

Description

Visualizing the world space geometry or shading normals on the face-culled geometry of the [DirectionalLight.gltf](https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/DirectionalLight) shows that they are pointing to the inside
(here: color = N * 0.5f + 0.5f;)
![DirectionalLight_single_sided](https://github.com/KhronosGroup/glTF-Sample-Assets/assets/7803175/06d6c504-4f94-49ba-821a-7bf448a550a1)
Also visualizing the front-face condition showed that this is actually the front-face so vertex winding and normal on front-face is consistent.
Consequently, switching the three materials to double-sided shows the expected normal orientation of the outside of the spheres:
![DirectionalLight_double_sided](https://github.com/KhronosGroup/glTF-Sample-Assets/assets/7803175/6f30c913-b953-4f15-922c-2cef9fbd0c1d)

This results in black rendering with a ray tracer because the inside of the sphere is hit and light is blocked by the face-culled geometry in front. Switching to double-sided materials produces the correct result.

Contributor guide

Open the contributing guide

Research direction

Start with the DirectionalLight.gltf asset linked in the issue and reproduce the problem using single-sided face culling and a ray tracer. Inspect the sphere geometry and its front-face behavior; done means the three materials render the sphere exteriors correctly without requiring double-sided materials.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.