Custom shader language #5

Open
opened 2025-08-28 17:30:38 +02:00 by Daniel · 0 comments
Owner

This is very much up for changes, depending on what I will learn while developing as it is now!

I don't want to always calculate the position of something inside the shader myself
Therefore an adaptation of glsl should be made.

The model, view and projection matrices should automatically be transmitted to the shader. To do this, the vertex shader needs to be adapted during compile time (so when creating the "Shader" object).

  • Add the three uniforms for the above mentioned matrices
  • inside the main function add the lines for making the position a vec4 and setting the variable/uniform "gl_position"
  • Basically all the "layout(location=x) in vec3 position" can also be added at the same time.

like in Unity, of course the matrices would still be accessible to the user. The user just doesn't have to always do it manually

Additionally, make vertex and fragment shader be one file instead of two and then split them up before compiling.

With this a lot of redundant work can potentially be reduced

This is very much up for changes, depending on what I will learn while developing as it is now! I don't want to always calculate the position of something inside the shader myself Therefore an adaptation of glsl should be made. The model, view and projection matrices should automatically be transmitted to the shader. To do this, the vertex shader needs to be adapted during compile time (so when creating the "Shader" object). - Add the three uniforms for the above mentioned matrices - inside the main function add the lines for making the position a vec4 and setting the variable/uniform "gl_position" - Basically all the "layout(location=x) in vec3 position" can also be added at the same time. like in Unity, of course the matrices would still be accessible to the user. The user just doesn't have to always do it manually Additionally, make vertex and fragment shader be one file instead of two and then split them up before compiling. With this a lot of redundant work can potentially be reduced
Daniel added this to the Prototype project 2025-08-28 17:30:38 +02:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Daniel/Engine.rs#5
No description provided.