mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-10 16:01:50 -04:00
fix particle fog
`finFragmentPosition` was not set. This caused the fog to not appear. Some gpu drivers (e.g. intel) also heavily optimized the fog code and completely removed the uniform `uCameraPosition`, thus minosoft crashed when setting the value on those gpus.
This commit is contained in:
parent
ff92b1f0db
commit
a433215260
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
* Copyright (C) 2020-2024 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -54,5 +54,4 @@ class ShaderUniform<T>(
|
|||||||
upload()
|
upload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ uniform vec3 uCameraRight;
|
|||||||
uniform vec3 uCameraUp;
|
uniform vec3 uCameraUp;
|
||||||
|
|
||||||
out vec4 finTintColor;
|
out vec4 finTintColor;
|
||||||
|
out vec3 finFragmentPosition;
|
||||||
|
|
||||||
in Vertex
|
in Vertex
|
||||||
{
|
{
|
||||||
@ -41,8 +42,9 @@ in Vertex
|
|||||||
|
|
||||||
void emit(vec3 offset, vec2 uv) {
|
void emit(vec3 offset, vec2 uv) {
|
||||||
vec3 pointPosition = gl_in[0].gl_Position.xyz;
|
vec3 pointPosition = gl_in[0].gl_Position.xyz;
|
||||||
|
finFragmentPosition = pointPosition + (offset * ginVertex[0].scale);
|
||||||
|
|
||||||
gl_Position = uViewProjectionMatrix * vec4(pointPosition + offset * ginVertex[0].scale, 1.0);
|
gl_Position = uViewProjectionMatrix * vec4(finFragmentPosition, 1.0f);
|
||||||
finAnimationUV = uv;
|
finAnimationUV = uv;
|
||||||
|
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user