1.shader中的WorldMatrix增加viewport resolution数据
2.Push constant中只保留local to world数据
This commit is contained in:
parent
31bfc6df93
commit
0249968785
@ -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()
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user