aconstlink / motor

Software Framework for Audio/Visual/Interactive Real-Time Applications
MIT License
1 stars 0 forks source link

msl noise build-ins #69

Closed aconstlink closed 3 months ago

aconstlink commented 3 months ago

From within an msl shader new build-in function are required for real-time noise generation. Many are noted here which I would like to try.

I think those shaders could go along with generator and be generated into the api code directly.

This approach is more for real-time demo purposes rather then game programming. If the user is sufficiently satisfied with a noise result, the noise value do not need to be recreated every shader call. So for this purpose we will have #68 by using a simple texture lookup.

aconstlink commented 3 months ago

glsl generator is missing at the moment

aconstlink commented 3 months ago

After some msl refactoring and inserting new code the requirement of #61 comes even closer. There is no way to overload a function right now. So overloads like

float_t noise( float_t ) ;
vec2_t noise( vec2_t ) ;
float_t noise( float_t, float_t ) ;

are absolutely not possible right now. With build-ins it is even worse than with library functions because build-ins can only be present with exactly one signature!

Well, of course the code could simply return all signatures of a specific used build-in so that all of them are inserted and let the api compiler deal with overloading. That in turn would increase code size of the api shader code.

aconstlink commented 3 months ago

Ok this one is done. There are several noise buildins now. See the wiki