From 83ea12d1ead6a4e5c2052f186b48092b1d44dcab Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 7 Oct 2018 16:19:34 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9shader=E5=90=8D=E5=92=8C=E5=86=85?= =?UTF-8?q?=E5=BB=BA=E5=8F=98=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/Shaders/base.shader.h | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/libjin/Graphics/Shaders/base.shader.h') diff --git a/src/libjin/Graphics/Shaders/base.shader.h b/src/libjin/Graphics/Shaders/base.shader.h index 3790a47..b449008 100644 --- a/src/libjin/Graphics/Shaders/base.shader.h +++ b/src/libjin/Graphics/Shaders/base.shader.h @@ -51,26 +51,26 @@ static const char* base_vertex = R"( %s -uniform mat4 _projectionMatrix_; -uniform mat4 _modelMatrix_; +uniform mat4 jin_ProjectionMatrix; +uniform mat4 jin_ModelMatrix; -in vec2 _vert_coord_; -in vec2 _tex_coord_; +in vec2 jin_VertexCoords; +in vec2 jin_TextureCoords; -out vec4 _color; -out vec2 _xy; -out vec2 _uv; +out vec4 jin_Color; +out vec2 jin_XY; +out vec2 jin_UV; %s void main() { - vec4 v = _modelMatrix_ * vec4(_vert_coord_, 0, 1.0); - Vertex _v = vert(Vertex(v.xy, _tex_coord_)); - gl_Position = _projectionMatrix_ * vec4(_v.xy, 0, 1.0f); - _color = gl_Color; - _xy = _v.xy; - _uv = _v.uv; + vec4 v = jin_ModelMatrix * vec4(jin_VertexCoords, 0, 1.0); + Vertex _v = vert(Vertex(v.xy, jin_TextureCoords)); + gl_Position = jin_ProjectionMatrix * vec4(_v.xy, 0, 1.0f); + jin_Color = gl_Color; + jin_XY = _v.xy; + jin_UV = _v.uv; } )"; @@ -83,19 +83,19 @@ static const char* base_fragment = R"( %s -uniform Texture _main_texture_; +uniform Texture jin_MainTexture; -in vec4 _color; -in vec2 _xy; -in vec2 _uv; +in vec4 jin_Color; +in vec2 jin_XY; +in vec2 jin_UV; -out vec4 _outColor_; +out vec4 jin_OutColor; %s void main() { - _outColor_ = frag(_color, _main_texture_, Vertex(_xy, _uv)); + jin_OutColor = frag(jin_Color, jin_MainTexture, Vertex(jin_XY, jin_UV)); } )"; -- cgit v1.1-26-g67d0