MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Suggestion: Reduce unit test size for standard library

Open kwokcb opened this issue 1 year ago • 1 comments

Currently there are a lot of unit tests which are run for every code gen variant for shader generation and rendering tests.

Many of these are "trivial" and can be replaced by create an instance of that node and a downstream connection to a material node. Any upstream values can be tweaked to make them run properly (such as layering and math nodes in the pbr library).

The following is a preliminary script which uses the convert-to-material utilities under review in: https://github.com/AcademySoftwareFoundation/MaterialX/pull/1205, which has a dump of GLSL and OSL runs.

genMaterialsFromDefs.py.txt

Something like this could be run to generate 1 or more source files for testing.

Tests that it would not replace would be anything requiring specific resource bindings (including images, geometry streams, units and color management), material assignments and "materials" examples, and node connectivity.

kwokcb avatar Feb 28 '23 15:02 kwokcb