diff options
| author | hachem <im@hachem.wtf> | 2026-08-19 02:02:20 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-19 02:02:20 +0200 |
| commit | f7e05555fb4ff6d8e51bdb5734db4dab1841d593 (patch) | |
| tree | 353d350b19da7b84ca11e5801d33a921407a963e /Assets/Shaders/Grid.glsl | |
| parent | 5c5fc10d8938fd2da1922f01c638d42e70eb1ab1 (diff) | |
[feat]: migrate to slang from glsl
Diffstat (limited to 'Assets/Shaders/Grid.glsl')
| -rw-r--r-- | Assets/Shaders/Grid.glsl | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/Assets/Shaders/Grid.glsl b/Assets/Shaders/Grid.glsl deleted file mode 100644 index 32c091a..0000000 --- a/Assets/Shaders/Grid.glsl +++ /dev/null @@ -1,41 +0,0 @@ -#type vertex - -#version 330 core - -layout(location = 0) in vec3 a_Position; - -uniform mat4 u_ViewProjection; -uniform mat4 u_Transform; -uniform float u_GridSize; - -void main() -{ - // Scale the grid based on the grid size uniform - vec3 scaledPosition = a_Position * (u_GridSize / 50.0); - gl_Position = u_ViewProjection * u_Transform * vec4(scaledPosition, 1.0); -} - -#type fragment - -#version 330 core - -uniform vec3 u_GridColor; -uniform float u_GridAlpha; -uniform float u_GridSize; -uniform vec3 u_CameraPos; - -out vec4 o_FragColor; - -void main() -{ - float distance = length(u_CameraPos); - float fadeFactor = 1.0 - clamp(distance / 100.0, 0.0, 0.8); - - vec3 color = u_GridColor; - float alpha = u_GridAlpha * fadeFactor; - - float gridFade = 1.0 - clamp(distance / 50.0, 0.0, 0.9); - alpha *= gridFade; - - o_FragColor = vec4(color, alpha); -} |
