New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLSL Shader API #207
Comments
+1 :) |
Seeing as we're currently switching to Vulkan #208 this API will involve compiling GLSL to SPIR-V. There are already multiple solutions for this, but there are a few things important to nannou that are worth investigating:
|
Adding in some thoughts for the functionality the shader API should enable. Loading Here might be some common use cases for loading external shader files.
A lot of times when you are only concerned with using a fragment shader for post processing of doing all your graphics inside the frag shader you end up using a passthrough vertex shader. It would be awesome if the user in this instance could define just a frag shader and then nannou loads a default passthrough vertex shader behind the scenes for them. Finally, it would be worth allowing users to write out the shader file as a string in the rust code that can get passed in for loading. Setting Uniform Variables
Each uniform variable is referenced by it's variable name defined in the shader, and then the appropriate data type is provided by nannou to update that variable. Uniform Buffer Objects
Then in nannou, you could have a data type that matches the type defined in the shader like so.
This way you can update a group of variables each frame and pass just a single type into the shader. Sometimes this could be considered slower, but there are cases when this technique is very useful. Passing in Textures to the Shader I've had problems in the past have to Default uniforms Also, when passing in a mesh, inside the vertex shader there should be defaults for accessing texcoords, position, colour, normals. Passing a Mesh to Draw onto.
Reading and Writing Data Handy Shader Functions Built Into Nannou @mitchmindtree & @freesig anything else you can think of that would be nice? |
No description provided.
The text was updated successfully, but these errors were encountered: