1.shader中的WorldMatrix增加viewport resolution数据

2.Push constant中只保留local to world数据
This commit is contained in:
hyzboy 2020-06-12 15:54:36 +08:00
parent 31bfc6df93
commit 0249968785
3 changed files with 8 additions and 8 deletions

View File

@ -16,7 +16,8 @@ layout(binding=0) uniform WorldMatrix // hgl/math/Math.h
mat4 inverse_mvp;
vec4 view_pos;
vec2 resolution;
vec2 canvas_resolution;
vec2 viewport_resolution;
} world;
void main()

View File

@ -1,4 +1,4 @@
#version 450 core
#version 450 core
layout(location = 0) in vec3 Vertex;
@ -16,7 +16,8 @@ layout(binding=0) uniform WorldMatrix // hgl/math/Math.h
mat4 inverse_mvp;
vec4 view_pos;
vec2 resolution;
vec2 canvas_resolution;
vec2 viewport_resolution;
} world;
layout(push_constant) uniform Consts {

View File

@ -1,4 +1,4 @@
#version 450 core
#version 450 core
layout(location = 0) in vec3 Vertex;
layout(location = 1) in vec4 Color;
@ -17,15 +17,13 @@ layout(binding=0) uniform WorldMatrix // hgl/math/Math.h
mat4 inverse_mvp;
vec4 view_pos;
vec2 resolution;
vec2 canvas_resolution;
vec2 viewport_resolution;
} world;
layout(push_constant) uniform Consts
{
mat4 local_to_world;
mat3 normal;
vec3 object_position;
vec3 object_size;
}pc;
layout(location = 0) out vec4 FragmentColor;