From 3290bb2b2dec223f0312c6d5fc3edf71d5d6e46f Mon Sep 17 00:00:00 2001 From: rtk0c Date: Tue, 19 Apr 2022 12:36:02 -0700 Subject: Changeset: 12 Add hardcoded dependencies for IresManager, migrate Shader to Ires --- assets/.stationary/Shaders/Default.glsl | 38 ++++++++++++++++++ assets/Ires/M_BasicWall.json | 13 +++++- assets/Ires/M_Default.json | 13 +++++- assets/Ires/M_Player.json | 13 +++++- assets/Ires/S_Default.json | 70 +++++++++++++++++++++++++++++++++ assets/Shaders/S_Default.glsl | 38 ------------------ assets/Shaders/S_Default.json | 65 ------------------------------ 7 files changed, 144 insertions(+), 106 deletions(-) create mode 100644 assets/.stationary/Shaders/Default.glsl create mode 100644 assets/Ires/S_Default.json delete mode 100644 assets/Shaders/S_Default.glsl delete mode 100644 assets/Shaders/S_Default.json (limited to 'assets') diff --git a/assets/.stationary/Shaders/Default.glsl b/assets/.stationary/Shaders/Default.glsl new file mode 100644 index 0000000..1d93471 --- /dev/null +++ b/assets/.stationary/Shaders/Default.glsl @@ -0,0 +1,38 @@ +#type vertex +#version 330 core + +layout(location = 0) in vec3 pos; +layout(location = 1) in vec4 color; +layout(location = 2) in vec2 texcoord; + +out Vertex2Fragmnet { + vec4 color; + vec2 texcoord; +} v2f; + +// Autofill uniforms +uniform mat4 transformation; + +void main() { + gl_Position = transformation * vec4(pos, 1.0); + v2f.color = color; + v2f.texcoord = texcoord; +} + +#type fragment +#version 330 core + +in Vertex2Fragmnet { + vec4 color; + vec2 texcoord; +} v2f; + +out vec4 fragColor; + +// Material uniforms +uniform sampler2D textureAtlas; +uniform vec4 taint; + +void main() { + fragColor = texture(textureAtlas, v2f.texcoord) * v2f.color * taint; +} diff --git a/assets/Ires/M_BasicWall.json b/assets/Ires/M_BasicWall.json index 95cc7b9..a0e2395 100644 --- a/assets/Ires/M_BasicWall.json +++ b/assets/Ires/M_BasicWall.json @@ -1 +1,12 @@ -{"Type":"IresMaterial","Uid":[10768502134278852816,15014213992450765275],"Value":{"ShaderName":"S_Default","Fields":[{"Name":"taint","Type":"Vector","Value":[0.37144365906715393,0.5479920506477356,0.5784313678741455,1.0]}]}} \ No newline at end of file +{ + "Type": "IresMaterial", + "Uid": [2568492772925683063, 3783268081215530432], + "Value": { + "Shader": [10239352483866045204, 2308094336962663863], + "Fields": [{ + "Name": "taint", + "Type": "Vector", + "Value": [0.03868706524372101, 0.6346951127052307, 0.7892156839370728, 0.0] + }] + } +} \ No newline at end of file diff --git a/assets/Ires/M_Default.json b/assets/Ires/M_Default.json index daa1a60..0422e94 100644 --- a/assets/Ires/M_Default.json +++ b/assets/Ires/M_Default.json @@ -1 +1,12 @@ -{"Type":"IresMaterial","Uid":[12204622401017240396,7687764162748902358],"Value":{"ShaderName":"S_Default","Fields":[{"Name":"taint","Type":"Vector","Value":[1.0,1.0,1.0,0.0]}]}} \ No newline at end of file +{ + "Type": "IresMaterial", + "Uid": [1173927873865027620, 6990602806197486151], + "Value": { + "Shader": [10239352483866045204, 2308094336962663863], + "Fields": [{ + "Name": "taint", + "Type": "Vector", + "Value": [1.0, 1.0, 1.0, 0.0] + }] + } +} \ No newline at end of file diff --git a/assets/Ires/M_Player.json b/assets/Ires/M_Player.json index 4065cf8..b2494dc 100644 --- a/assets/Ires/M_Player.json +++ b/assets/Ires/M_Player.json @@ -1 +1,12 @@ -{"Type":"IresMaterial","Uid":[9758347138487553657,17909177141494883507],"Value":{"ShaderName":"S_Default","Fields":[{"Name":"taint","Type":"Vector","Value":[1.0,1.0,1.0,0.0]}]}} \ No newline at end of file +{ + "Type": "IresMaterial", + "Uid": [8784140338803637141, 14601353797962284625], + "Value": { + "Shader": [10239352483866045204, 2308094336962663863], + "Fields": [{ + "Name": "taint", + "Type": "Vector", + "Value": [1.0, 1.0, 1.0, 0.0] + }] + } +} \ No newline at end of file diff --git a/assets/Ires/S_Default.json b/assets/Ires/S_Default.json new file mode 100644 index 0000000..15c16d9 --- /dev/null +++ b/assets/Ires/S_Default.json @@ -0,0 +1,70 @@ +{ + "Type": "IresShader", + "Uid": [10239352483866045204, 2308094336962663863], + "Value": { + "SourceFile": ".stationary/Shaders/Default.glsl", + "Inputs": [ + { + "Semantic": "Position", + "Name": "pos", + "ScalarType": "float", + "Width": 1, + "Height": 3, + "OpenGLLocation": 0 + }, + { + "Semantic": "TexCoords1", + "Name": "texcoord", + "ScalarType": "float", + "Width": 1, + "Height": 2, + "OpenGLLocation": 1 + }, + { + "Semantic": "Color1", + "Name": "color", + "ScalarType": "float", + "Width": 1, + "Height": 4, + "OpenGLLocation": 2 + } + ], + "Outputs": [ + { + "Name": "fragColor", + "ScalarType": "float", + "Width": 1, + "Height": 4, + "OpenGLLocation": 0 + } + ], + "Uniforms": [ + { + "Type": "Math", + "AutoFill": true, + "Value": { + "Name": "transformation", + "ScalarType": "float", + "Width": 4, + "Height": 4 + } + }, + { + "Type": "Math", + "Value": { + "Name": "taint", + "Semantic": "Color1", + "ScalarType": "float", + "Width": 1, + "Height": 4 + } + }, + { + "Type": "Sampler", + "Value": { + "Name": "textureAtlas" + } + } + ] + } +} \ No newline at end of file diff --git a/assets/Shaders/S_Default.glsl b/assets/Shaders/S_Default.glsl deleted file mode 100644 index 1d93471..0000000 --- a/assets/Shaders/S_Default.glsl +++ /dev/null @@ -1,38 +0,0 @@ -#type vertex -#version 330 core - -layout(location = 0) in vec3 pos; -layout(location = 1) in vec4 color; -layout(location = 2) in vec2 texcoord; - -out Vertex2Fragmnet { - vec4 color; - vec2 texcoord; -} v2f; - -// Autofill uniforms -uniform mat4 transformation; - -void main() { - gl_Position = transformation * vec4(pos, 1.0); - v2f.color = color; - v2f.texcoord = texcoord; -} - -#type fragment -#version 330 core - -in Vertex2Fragmnet { - vec4 color; - vec2 texcoord; -} v2f; - -out vec4 fragColor; - -// Material uniforms -uniform sampler2D textureAtlas; -uniform vec4 taint; - -void main() { - fragColor = texture(textureAtlas, v2f.texcoord) * v2f.color * taint; -} diff --git a/assets/Shaders/S_Default.json b/assets/Shaders/S_Default.json deleted file mode 100644 index df37792..0000000 --- a/assets/Shaders/S_Default.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "Inputs": [ - { - "Semantic": "Position", - "Name": "pos", - "ScalarType": "float", - "Width": 1, - "Height": 3, - "OpenGLLocation": 0 - }, - { - "Semantic": "TexCoords1", - "Name": "texcoord", - "ScalarType": "float", - "Width": 1, - "Height": 2, - "OpenGLLocation": 1 - }, - { - "Semantic": "Color1", - "Name": "color", - "ScalarType": "float", - "Width": 1, - "Height": 4, - "OpenGLLocation": 2 - } - ], - "Outputs": [ - { - "Name": "fragColor", - "ScalarType": "float", - "Width": 1, - "Height": 4, - "OpenGLLocation": 0 - } - ], - "Uniforms": [ - { - "Type": "Math", - "AutoFill": true, - "Value": { - "Name": "transformation", - "ScalarType": "float", - "Width": 4, - "Height": 4 - } - }, - { - "Type": "Math", - "Value": { - "Name": "taint", - "Semantic": "Color1", - "ScalarType": "float", - "Width": 1, - "Height": 4 - } - }, - { - "Type": "Sampler", - "Value": { - "Name": "textureAtlas" - } - } - ] -} \ No newline at end of file -- cgit v1.2.3-70-g09d2