You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Add LIGHT_VERTEX to fragment shader
Adds a new variable to the fragment shader to specify the vertex position used when calculating lighting.
This commit is contained in:
@@ -830,6 +830,10 @@ void main() {
|
||||
inv_view_matrix[2][3] = 0.0;
|
||||
#endif
|
||||
|
||||
#ifdef LIGHT_VERTEX_USED
|
||||
vec3 light_vertex = vertex;
|
||||
#endif //LIGHT_VERTEX_USED
|
||||
|
||||
mat4 read_view_matrix = scene_data.view_matrix;
|
||||
vec2 read_viewport_size = scene_data.viewport_size;
|
||||
|
||||
@@ -837,6 +841,15 @@ void main() {
|
||||
#CODE : FRAGMENT
|
||||
}
|
||||
|
||||
#ifdef LIGHT_VERTEX_USED
|
||||
vertex = light_vertex;
|
||||
#ifdef USE_MULTIVIEW
|
||||
view = -normalize(vertex - eye_offset);
|
||||
#else
|
||||
view = -normalize(vertex);
|
||||
#endif //USE_MULTIVIEW
|
||||
#endif //LIGHT_VERTEX_USED
|
||||
|
||||
#ifdef LIGHT_TRANSMITTANCE_USED
|
||||
#ifdef SSS_MODE_SKIN
|
||||
transmittance_color.a = sss_strength;
|
||||
|
||||
Reference in New Issue
Block a user