aconstlink / natus

[Discontinued] Software Framework for Audio/Visual/Interactive Real-Time Applications
https://aconstlink.de
MIT License
0 stars 0 forks source link

VertexID, PrimitiveID, InstanceID in NSL #238

Closed aconstlink closed 1 year ago

aconstlink commented 3 years ago

NSL requires to generate the following build in variables and fill it in appropriately.

The InstanceID can be generated/set without the presence of hardware instancing. A new parameter could be added to thre render_detailstruct from the backend class.

Those ids could be introduced by binding points

int_t vid : vertex_id

A variable defined outside of shaders in configs will be global, so those are introduced into variable sets. The above example would require to introduce local variables that will not be settable through the variable set. Local variables are only available in the shader.

aconstlink commented 1 year ago

This is solved by introducing a new flow qualifier local. Those variables are not added to the variable sets but stay local to the shader. So constant values could be set to them.