diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000CE08.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000CE08.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000CE08.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000CE08.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000CF48.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000CF48.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000CF48.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000CF48.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D128.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D128.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D128.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D128.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D4CC.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D4CC.fragment.glsl index d68b61342..27fed7e18 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D4CC.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D4CC.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec4 vertexColor0; in vec2 uv0; @@ -8,7 +21,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = vertexColor0.a; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D6AC.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D6AC.fragment.glsl index d68b61342..27fed7e18 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D6AC.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D6AC.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec4 vertexColor0; in vec2 uv0; @@ -8,7 +21,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = vertexColor0.a; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D74C.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D74C.fragment.glsl index d68b61342..27fed7e18 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D74C.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D74C.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec4 vertexColor0; in vec2 uv0; @@ -8,7 +21,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = vertexColor0.a; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D7EC.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D7EC.fragment.glsl index d68b61342..27fed7e18 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D7EC.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D7EC.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec4 vertexColor0; in vec2 uv0; @@ -8,7 +21,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = vertexColor0.a; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D88C.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D88C.fragment.glsl index d68b61342..27fed7e18 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D88C.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000D88C.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec4 vertexColor0; in vec2 uv0; @@ -8,7 +21,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*vec3(1,0.20000000298023224,0)*vertexColor0.rgb*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = vertexColor0.a; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000DA6C.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000DA6C.fragment.glsl index 2b4a20e47..3d9d2ec8e 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000DA6C.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000DA6C.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec4 vertexColor0; in vec2 uv0; @@ -8,7 +21,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*vec3(0,0.800000011920929,0)*vertexColor0.rgb*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*vec3(0,0.800000011920929,0)*vertexColor0.rgb*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = vertexColor0.a; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000DBAC.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000DBAC.fragment.glsl index 2b4a20e47..3d9d2ec8e 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000DBAC.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/0000DBAC.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec4 vertexColor0; in vec2 uv0; @@ -8,7 +21,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*vec3(0,0.800000011920929,0)*vertexColor0.rgb*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*vec3(0,0.800000011920929,0)*vertexColor0.rgb*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = vertexColor0.a; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/jenny.glb b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/jenny.glb index 0dd5749fc..0d9196aa7 100644 Binary files a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/jenny.glb and b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/chibi_robo/jenny/output/jenny.glb differ diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00008F5C.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00008F5C.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00008F5C.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00008F5C.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000901C.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000901C.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000901C.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000901C.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/000090DC.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/000090DC.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/000090DC.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/000090DC.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/000095D0.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/000095D0.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/000095D0.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/000095D0.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00009B10.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00009B10.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00009B10.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00009B10.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00009F90.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00009F90.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00009F90.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/00009F90.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A110.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A110.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A110.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A110.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A650.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A650.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A650.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A650.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A710.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A710.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A710.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/0000A710.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/PlMrNr.glb b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/PlMrNr.glb index 01e9327a0..141ed8c28 100644 Binary files a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/PlMrNr.glb and b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlMr/output/PlMrNr.glb differ diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlZd/output/00008E30.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlZd/output/00008E30.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlZd/output/00008E30.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlZd/output/00008E30.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlZd/output/PlZdNr.glb b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlZd/output/PlZdNr.glb index 69e5d58a8..0a6538f56 100644 Binary files a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlZd/output/PlZdNr.glb and b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/PlZd/output/PlZdNr.glb differ diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002CD14.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002CD14.fragment.glsl index acbd6fac9..0115ab46f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002CD14.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002CD14.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -130,7 +143,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D1E8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D1E8.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D1E8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D1E8.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D7B4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D7B4.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D7B4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D7B4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D854.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D854.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D854.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D854.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D8F4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D8F4.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D8F4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D8F4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D994.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D994.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D994.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002D994.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DD54.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DD54.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DD54.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DD54.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DDF4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DDF4.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DDF4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DDF4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DE94.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DE94.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DE94.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DE94.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DFD4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DFD4.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DFD4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002DFD4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E074.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E074.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E074.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E074.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E114.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E114.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E114.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E114.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E1B4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E1B4.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E1B4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E1B4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E394.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E394.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E394.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E394.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E574.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E574.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E574.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E574.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E614.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E614.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E614.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E614.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E6B4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E6B4.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E6B4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E6B4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E754.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E754.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E754.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/0002E754.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/TyAndruf.glb b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/TyAndruf.glb index 5a83ed7a2..1a51f80ec 100644 Binary files a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/TyAndruf.glb and b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyAndruf/output/TyAndruf.glb differ diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B5F8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B5F8.fragment.glsl index f66d15dbe..1cf9b80ee 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B5F8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B5F8.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 sphericalReflectionUv; in vec2 uv0; @@ -8,7 +21,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = texture(texture0, sphericalReflectionUv).rgb; + vec3 colorComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, sphericalReflectionUv)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B6B8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B6B8.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B6B8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B6B8.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B778.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B778.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B778.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B778.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B818.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B818.fragment.glsl index d624d9746..9bf2fa43d 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B818.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B818.fragment.glsl @@ -1,13 +1,26 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B904.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B904.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B904.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000B904.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BCD4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BCD4.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BCD4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BCD4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BD74.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BD74.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BD74.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BD74.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BEB4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BEB4.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BEB4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000BEB4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C068.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C068.fragment.glsl index fe17ac96b..86346c2ec 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C068.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C068.fragment.glsl @@ -1,7 +1,20 @@ #version 430 -uniform sampler2D texture0; -uniform sampler2D texture1; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; +uniform Texture texture1; in vec2 sphericalReflectionUv; in vec2 uv0; @@ -10,7 +23,7 @@ in vec2 uv1; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb*texture(texture1, sphericalReflectionUv).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb*texture(texture1.sampler, transformUv3d(texture1.transform3d, sphericalReflectionUv)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C1A8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C1A8.fragment.glsl index 86f03ad1b..a30c7a5ab 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C1A8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C1A8.fragment.glsl @@ -1,6 +1,19 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 sphericalReflectionUv; in vec4 vertexColor0; @@ -9,7 +22,7 @@ in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*vertexColor0.rgb*vec3(0.5) + texture(texture0, sphericalReflectionUv).rgb*vec3(0.5); + vec3 colorComponent = vec3(2)*vertexColor0.rgb*vec3(0.5) + texture(texture0.sampler, transformUv3d(texture0.transform3d, sphericalReflectionUv)).rgb*vec3(0.5); float alphaComponent = 0.3499999940395355*vertexColor0.a; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C248.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C248.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C248.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C248.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C3A8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C3A8.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C3A8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C3A8.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C468.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C468.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C468.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C468.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C508.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C508.fragment.glsl index d624d9746..9bf2fa43d 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C508.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C508.fragment.glsl @@ -1,13 +1,26 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C5F4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C5F4.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C5F4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C5F4.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C694.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C694.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C694.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C694.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C7A8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C7A8.fragment.glsl index fe17ac96b..86346c2ec 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C7A8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C7A8.fragment.glsl @@ -1,7 +1,20 @@ #version 430 -uniform sampler2D texture0; -uniform sampler2D texture1; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; +uniform Texture texture1; in vec2 sphericalReflectionUv; in vec2 uv0; @@ -10,7 +23,7 @@ in vec2 uv1; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb*texture(texture1, sphericalReflectionUv).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb*texture(texture1.sampler, transformUv3d(texture1.transform3d, sphericalReflectionUv)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C868.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C868.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C868.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C868.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C928.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C928.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C928.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C928.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C9C8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C9C8.fragment.glsl index d624d9746..9bf2fa43d 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C9C8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000C9C8.fragment.glsl @@ -1,13 +1,26 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CAB4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CAB4.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CAB4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CAB4.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CB54.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CB54.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CB54.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CB54.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CC68.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CC68.fragment.glsl index fe17ac96b..86346c2ec 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CC68.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CC68.fragment.glsl @@ -1,7 +1,20 @@ #version 430 -uniform sampler2D texture0; -uniform sampler2D texture1; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; +uniform Texture texture1; in vec2 sphericalReflectionUv; in vec2 uv0; @@ -10,7 +23,7 @@ in vec2 uv1; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb*texture(texture1, sphericalReflectionUv).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb*texture(texture1.sampler, transformUv3d(texture1.transform3d, sphericalReflectionUv)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CD28.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CD28.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CD28.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CD28.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CDE8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CDE8.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CDE8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CDE8.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CE88.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CE88.fragment.glsl index d624d9746..9bf2fa43d 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CE88.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CE88.fragment.glsl @@ -1,13 +1,26 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CF74.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CF74.fragment.glsl index 7957871e5..54afd853f 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CF74.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000CF74.fragment.glsl @@ -1,15 +1,28 @@ #version 430 -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec2 uv0; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; - float alphaComponent = texture(texture0, uv0).a; + float alphaComponent = texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).a; fragColor = vec4(colorComponent, alphaComponent); diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000D014.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000D014.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000D014.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000D014.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000D128.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000D128.fragment.glsl index fe17ac96b..86346c2ec 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000D128.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/0000D128.fragment.glsl @@ -1,7 +1,20 @@ #version 430 -uniform sampler2D texture0; -uniform sampler2D texture1; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; +uniform Texture texture1; in vec2 sphericalReflectionUv; in vec2 uv0; @@ -10,7 +23,7 @@ in vec2 uv1; out vec4 fragColor; void main() { - vec3 colorComponent = vec3(2)*texture(texture0, uv0).rgb*texture(texture1, sphericalReflectionUv).rgb; + vec3 colorComponent = vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb*texture(texture1.sampler, transformUv3d(texture1.transform3d, sphericalReflectionUv)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/TyBField.glb b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/TyBField.glb index 9d2ad6e41..7609c178b 100644 Binary files a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/TyBField.glb and b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyBField/output/TyBField.glb differ diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000489D8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000489D8.fragment.glsl index 056eadaf7..a2b73db9a 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000489D8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000489D8.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00048BB8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00048BB8.fragment.glsl index 056eadaf7..a2b73db9a 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00048BB8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00048BB8.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00048C58.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00048C58.fragment.glsl index 056eadaf7..a2b73db9a 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00048C58.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00048C58.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00049018.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00049018.fragment.glsl index 056eadaf7..a2b73db9a 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00049018.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00049018.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000490B8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000490B8.fragment.glsl index 056eadaf7..a2b73db9a 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000490B8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000490B8.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00049338.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00049338.fragment.glsl index 056eadaf7..a2b73db9a 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00049338.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/00049338.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000495B8.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000495B8.fragment.glsl index 056eadaf7..a2b73db9a 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000495B8.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/000495B8.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + vec3(1,0.9960784316062927,0)*mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/TyDaisy.glb b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/TyDaisy.glb index 93c011327..b96d65b13 100644 Binary files a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/TyDaisy.glb and b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyDaisy/output/TyDaisy.glb differ diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00006684.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00006684.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00006684.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00006684.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/000067D4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/000067D4.fragment.glsl index f1102e673..8f5d8c0d1 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/000067D4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/000067D4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007464.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007464.fragment.glsl index f1102e673..8f5d8c0d1 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007464.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007464.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007504.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007504.fragment.glsl index f1102e673..8f5d8c0d1 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007504.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007504.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/000075A4.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/000075A4.fragment.glsl index f1102e673..8f5d8c0d1 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/000075A4.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/000075A4.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007644.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007644.fragment.glsl index f1102e673..8f5d8c0d1 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007644.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/00007644.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb + mergedLightSpecularColor.rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb + mergedLightSpecularColor.rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/TyGmCube.glb b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/TyGmCube.glb index 8398102b3..56e6b031e 100644 Binary files a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/TyGmCube.glb and b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGmCube/output/TyGmCube.glb differ diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGwfeld/output/00005614.fragment.glsl b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGwfeld/output/00005614.fragment.glsl index 51718c8ba..339f9c336 100644 --- a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGwfeld/output/00005614.fragment.glsl +++ b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGwfeld/output/00005614.fragment.glsl @@ -30,7 +30,20 @@ layout (std140, binding = 2) uniform Lights { uniform vec3 cameraPosition; uniform float shininess; -uniform sampler2D texture0; + +struct Texture { + sampler2D sampler; + mat4 transform3d; +}; + +vec2 transformUv3d(mat4 transform3d, vec2 inUv) { + vec4 rawTransformedUv = (transform3d * vec4(inUv, 0, 1)); + + // We need to manually divide by w for perspective correction! + return rawTransformedUv.xy / rawTransformedUv.w; +} + +uniform Texture texture0; in vec3 vertexPosition; in vec3 vertexNormal; @@ -129,7 +142,7 @@ void main() { vec4 mergedLightSpecularColor = vec4(0); getMergedLightColors(vertexPosition, fragNormal, shininess, mergedLightDiffuseColor, mergedLightSpecularColor); - vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0, uv0).rgb; + vec3 colorComponent = mergedLightDiffuseColor.rgb*vec3(2)*texture(texture0.sampler, transformUv3d(texture0.transform3d, uv0)).rgb; float alphaComponent = 1; diff --git a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGwfeld/output/TyGwfeld.glb b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGwfeld/output/TyGwfeld.glb index 959ac2b10..fbe17bdc6 100644 Binary files a/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGwfeld/output/TyGwfeld.glb and b/FinModelUtility/Formats/Hsd/Hsd Tests/goldens/super_smash_bros_melee/TyGwfeld/output/TyGwfeld.glb differ