scenerygraphics / scenery

Flexible VR Visualisation for Volumetric and Geometric Data on the Java VM, powered by Kotlin and Vulkan.
https://scenery.graphics
GNU Lesser General Public License v3.0
131 stars 32 forks source link

add DeferredInstancedColor shaders #749

Closed smlpt closed 6 months ago

smlpt commented 6 months ago

This PR adds a new fragment & vertex shader type to be used for coloring individual instances of instanced geometry.

The syntax for writing the color attribute is:

InstancedNode.Instance.instancedProperties["Color"] = { Vector4f(1f) }

The code is largely taken from this and this ParticleDemo shader in Sciview.