Custom shader language #5

Open
opened 2025-08-28 17:30:38 +02:00 by Daniel · 0 comments
Daniel commented 2025-08-28 17:30:38 +02:00 (Migrated from git.elosia.mooo.com)

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
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
daniel/Engine.rs#5
No description provided.