pex-gl/pex-gui

Add support for textures in addParam

vorg opened this issue · 2 comments

vorg commented

Currently we need to use gui.addTexture2D(name, tex) instead of gui.addParam(name, obj, propName). This means tex can't be null and the gui will not update when the texture object is replaced with another one.

Use case: shadows maps of lights that initialize with shadowCasting off but then get it on.

@vorg do we make this as a breaking change and remove addTexture2D/Cube from the API or keep both?

Kept both method as we have probably a lot of examples relying on gui.addTexture2D.
Updated the docs to reflect the fact it is not possible to update textures with the method above.

To notes: only way to check for an object created by pex-context is checking the class property on the object (cc 6ed1611#diff-7d7a73d5d66c3c4b526fa3dd8326eeebR519). Not the strongest check so could be improved in pex-context somehow.