AcademySoftwareFoundation / AcademySoftwareFoundation/MaterialX
Unlit h/w code optimization does not work with definitions
- Dominant language
- C++
- Stars
- 2.3k
- Forks
- 451
- Avg merge
- 6d 6h
- Merged PRs (30d)
- 5
Description
There is an optimization to avoid emitting lighting fragments for h/w code generation
* if an "unlit" surfaceshader is defected does not work if the shader is inside a definition.
It will always omit lighting.
* Also the environment lighting information never performs any check so is always included
though unused.
* Finally for unit tests which empty out the direct lighting list, this results in a strange situation where
you emit the direct lighting code but not the maximum number of lights uniform.
Seems in part that the GLSL code has a requiresLighting() logic that is only used in one place but not others.
Example:
```xml
```
Contributor guide
Research direction
Start by tracing the GLSL requiresLighting() logic and the hardware code-generation path for surfaces inside definitions, using the XML example to compare both cases. Check how direct lighting, environment lighting, and the maximum-lights uniform are emitted, then add or run unit coverage showing that unused lighting fragments and uniforms are omitted consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100