Use defines for packed textures to satisfy both GLES and GL 4.1

This commit is contained in:
Brad Davis 2018-08-06 14:35:36 -07:00
parent 993e1e1c4d
commit dcdc3a323c
48 changed files with 95 additions and 95 deletions

View file

@ -23,8 +23,8 @@
<$declareEvalAmbientSphereGlobalColor(supportScattering)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=0) out vec4 _fragColor;
void main(void) {

View file

@ -21,8 +21,8 @@
<$declareEvalAmbientSphereGlobalColor(isScattering)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=0) out vec4 _fragColor;
void main(void) {

View file

@ -20,8 +20,8 @@
<$declareEvalSkyboxGlobalColor(isScattering)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=0) out vec4 _fragColor;
void main(void) {

View file

@ -21,8 +21,8 @@
<$declareEvalSkyboxGlobalColor(isScattering)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=0) out vec4 _fragColor;
void main(void) {

View file

@ -27,8 +27,8 @@
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -25,8 +25,8 @@
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) in vec3 _tangentWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -24,8 +24,8 @@
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -20,8 +20,8 @@
<$declareMaterialTextures(ALBEDO)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=0) out vec4 _fragColor0;

View file

@ -22,8 +22,8 @@ layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_NORMAL_MS) in vec3 _normalMS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_MS) in vec4 _positionMS;
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;

View file

@ -28,8 +28,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=0) out vec4 _fragColor0;

View file

@ -28,8 +28,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=0) out vec4 _fragColor0;

View file

@ -24,8 +24,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
void main(void) {
vec4 texel = texture(originalTexture, _texCoord0.st);

View file

@ -21,8 +21,8 @@ layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_NORMAL_MS) in vec3 _normalMS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_MS) in vec4 _positionMS;
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;

View file

@ -24,8 +24,8 @@ layout(std140, binding=0) uniform hudBuffer {
};
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=0) out vec4 fragColor0;

View file

@ -34,8 +34,8 @@
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=0) out vec4 _fragColor;
void main(void) {

View file

@ -22,8 +22,8 @@
<@include render-utils/ShaderConstants.h@>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=0) out vec4 _fragColor;
void main(void) {

View file

@ -20,8 +20,8 @@
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, METALLIC, EMISSIVE, OCCLUSION, SCATTERING)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -26,8 +26,8 @@
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -22,8 +22,8 @@
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -26,8 +26,8 @@
<@include render-utils/ShaderConstants.h@>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;

View file

@ -22,8 +22,8 @@
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) in vec3 _tangentWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -27,8 +27,8 @@
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) in vec3 _tangentWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -21,8 +21,8 @@
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) in vec3 _tangentWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -25,8 +25,8 @@
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) in vec3 _tangentWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -27,8 +27,8 @@
<$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, _SCRIBE_NULL, EMISSIVE, OCCLUSION)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;

View file

@ -25,8 +25,8 @@
<@include render-utils/ShaderConstants.h@>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;

View file

@ -29,8 +29,8 @@
<@include render-utils/ShaderConstants.h@>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;

View file

@ -33,8 +33,8 @@
<@include render-utils/ShaderConstants.h@>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_TANGENT_WS) in vec3 _tangentWS;

View file

@ -21,8 +21,8 @@
<@include render-utils/ShaderConstants.h@>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=0) out vec4 _fragColor;

View file

@ -24,8 +24,8 @@
<@include render-utils/ShaderConstants.h@>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;

View file

@ -21,8 +21,8 @@
<$declareMaterialTextures(ALBEDO)$>
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -25,8 +25,8 @@
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;

View file

@ -27,7 +27,7 @@ layout(location=0) out vec4 _color;
void main(void) {
_color = color;
float t = parabolicDistance * (floor(gl_VertexID / 2) / float(numSections));
float t = parabolicDistance * (float(gl_VertexID / 2) / float(numSections));
vec4 pos = vec4(velocity * t + 0.5 * acceleration * t * t, 1);
const float EPSILON = 0.00001;

View file

@ -20,8 +20,8 @@ layout(location=RENDER_UTILS_UNIFORM_TEXT_COLOR) uniform vec4 Color;
// the interpolated normal
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
#define TAA_TEXTURE_LOD_BIAS -3.0

View file

@ -20,8 +20,8 @@ layout(location=RENDER_UTILS_UNIFORM_TEXT_COLOR) uniform vec4 Color;
// the interpolated normal
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
const float gamma = 2.2;
const float smoothing = 32.0;

View file

@ -21,8 +21,8 @@ layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_NORMAL_MS) in vec3 _normalMS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_MS) in vec4 _positionMS;
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;

View file

@ -24,8 +24,8 @@ layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_NORMAL_MS) in vec3 _normalMS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_MS) in vec4 _positionMS;
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;

View file

@ -24,8 +24,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
void main(void) {
vec4 texel = texture(originalTexture, _texCoord0.st);

View file

@ -23,8 +23,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
void main(void) {
vec4 texel = texture(originalTexture, _texCoord0);

View file

@ -26,8 +26,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
// Declare after all samplers to prevent sampler location mix up with originalTexture

View file

@ -24,8 +24,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
void main(void) {
vec4 texel = texture(originalTexture, _texCoord0.st);

View file

@ -26,8 +26,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
// Declare after all samplers to prevent sampler location mix up with originalTexture

View file

@ -21,8 +21,8 @@ layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_NORMAL_MS) in vec3 _normalMS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_MS) in vec4 _positionMS;
layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;

View file

@ -23,8 +23,8 @@ layout(location=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
void main(void) {
vec4 texel = texture(originalTexture, _texCoord0);

View file

@ -32,8 +32,8 @@ layout(location=RENDER_UTILS_ATTR_POSITION_ES) in vec4 _positionES;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
// Declare after all samplers to prevent sampler location mix up with originalTexture

View file

@ -21,8 +21,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=0) out vec4 _fragColor0;

View file

@ -23,8 +23,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
layout(location=RENDER_UTILS_ATTR_POSITION_WS) in vec4 _positionWS;
layout(location=0) out vec4 _fragColor0;

View file

@ -24,8 +24,8 @@ layout(binding=0) uniform sampler2D originalTexture;
layout(location=RENDER_UTILS_ATTR_NORMAL_WS) in vec3 _normalWS;
layout(location=RENDER_UTILS_ATTR_COLOR) in vec4 _color;
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
vec2 _texCoord0 = _texCoord01.xy;
vec2 _texCoord1 = _texCoord01.zw;
#define _texCoord0 _texCoord01.xy
#define _texCoord1 _texCoord01.zw
void main(void) {
vec4 texel = texture(originalTexture, _texCoord0.st);