mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #71455 from BastiaanOlij/fix_stereo_screen_depth
Make screen texture and depth texture work in Multiview
This commit is contained in:
commit
4b0363312e
15 changed files with 103 additions and 23 deletions
|
|
@ -565,9 +565,15 @@ uniform highp samplerCubeShadow positional_shadow; // texunit:-4
|
|||
#ifdef USE_MULTIVIEW
|
||||
uniform highp sampler2DArray depth_buffer; // texunit:-6
|
||||
uniform highp sampler2DArray color_buffer; // texunit:-5
|
||||
vec3 multiview_uv(vec2 uv) {
|
||||
return vec3(uv, ViewIndex);
|
||||
}
|
||||
#else
|
||||
uniform highp sampler2D depth_buffer; // texunit:-6
|
||||
uniform highp sampler2D color_buffer; // texunit:-5
|
||||
vec2 multiview_uv(vec2 uv) {
|
||||
return uv;
|
||||
}
|
||||
#endif
|
||||
|
||||
uniform highp mat4 world_transform;
|
||||
|
|
@ -925,8 +931,12 @@ void main() {
|
|||
vec3 vertex = vertex_interp;
|
||||
#ifdef USE_MULTIVIEW
|
||||
vec3 view = -normalize(vertex_interp - multiview_data.eye_offset[ViewIndex].xyz);
|
||||
mat4 projection_matrix = multiview_data.projection_matrix_view[ViewIndex];
|
||||
mat4 inv_projection_matrix = multiview_data.inv_projection_matrix_view[ViewIndex];
|
||||
#else
|
||||
vec3 view = -normalize(vertex_interp);
|
||||
mat4 projection_matrix = scene_data.projection_matrix;
|
||||
mat4 inv_projection_matrix = scene_data.inv_projection_matrix;
|
||||
#endif
|
||||
highp mat4 model_matrix = world_transform;
|
||||
vec3 albedo = vec3(1.0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue