mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-10 03:55:20 +01:00
Port most shaders to GLSL ES 3.0 (#16639)
This commit is contained in:
@@ -6,7 +6,7 @@ uniform sampler2D textureFlags;
|
||||
#define rightImage normalTexture
|
||||
#define maskImage textureFlags
|
||||
|
||||
varying mediump vec4 varTexCoord;
|
||||
VARYING_ mediump vec4 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
varying mediump vec4 varTexCoord;
|
||||
VARYING_ mediump vec4 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
uniform sampler2D rendered;
|
||||
uniform vec2 texelSize0;
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -6,11 +6,7 @@ uniform sampler2D previous;
|
||||
uniform vec2 texelSize0;
|
||||
uniform mediump float bloomRadius;
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -5,11 +5,7 @@ uniform vec2 texelSize0;
|
||||
uniform mediump float bloomRadius;
|
||||
uniform mat3 bloomBlurWeights;
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
// smoothstep - squared
|
||||
float smstsq(float f)
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -5,11 +5,7 @@ uniform vec2 texelSize0;
|
||||
uniform mediump float bloomRadius;
|
||||
uniform mat3 bloomBlurWeights;
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
// smoothstep - squared
|
||||
float smstsq(float f)
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
uniform lowp vec4 fogColor;
|
||||
uniform float fogDistance;
|
||||
uniform float fogShadingParameter;
|
||||
varying highp vec3 eyeVec;
|
||||
VARYING_ highp vec3 eyeVec;
|
||||
|
||||
varying lowp vec4 varColor;
|
||||
VARYING_ lowp vec4 varColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
uniform lowp vec4 materialColor;
|
||||
|
||||
varying lowp vec4 varColor;
|
||||
VARYING_ lowp vec4 varColor;
|
||||
|
||||
varying highp vec3 eyeVec;
|
||||
VARYING_ highp vec3 eyeVec;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -8,14 +8,10 @@ uniform sampler2D rendered;
|
||||
uniform mediump float bloomStrength;
|
||||
uniform ExposureParams exposureParams;
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
#ifdef ENABLE_AUTO_EXPOSURE
|
||||
varying float exposure; // linear exposure factor, see vertex shader
|
||||
VARYING_ float exposure; // linear exposure factor, see vertex shader
|
||||
#endif
|
||||
|
||||
void main(void)
|
||||
|
||||
@@ -3,14 +3,10 @@
|
||||
|
||||
uniform sampler2D exposureMap;
|
||||
|
||||
varying float exposure;
|
||||
VARYING_ float exposure;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
|
||||
void main(void)
|
||||
|
||||
@@ -3,16 +3,12 @@
|
||||
uniform sampler2D rendered;
|
||||
uniform vec2 texelSize0;
|
||||
|
||||
varying vec2 sampleNW;
|
||||
varying vec2 sampleNE;
|
||||
varying vec2 sampleSW;
|
||||
varying vec2 sampleSE;
|
||||
VARYING_ vec2 sampleNW;
|
||||
VARYING_ vec2 sampleNE;
|
||||
VARYING_ vec2 sampleSW;
|
||||
VARYING_ vec2 sampleSE;
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
/**
|
||||
Basic FXAA implementation based on the code on geeks3d.com with the
|
||||
@@ -63,7 +59,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,
|
||||
vec2 v_rgbNW, vec2 v_rgbNE,
|
||||
vec2 v_rgbSW, vec2 v_rgbSE,
|
||||
vec2 v_rgbM) {
|
||||
vec2 v_rgbM)
|
||||
{
|
||||
vec4 color;
|
||||
vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
|
||||
vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
uniform vec2 texelSize0;
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
varying vec2 sampleNW;
|
||||
varying vec2 sampleNE;
|
||||
varying vec2 sampleSW;
|
||||
varying vec2 sampleSE;
|
||||
VARYING_ vec2 sampleNW;
|
||||
VARYING_ vec2 sampleNE;
|
||||
VARYING_ vec2 sampleSW;
|
||||
VARYING_ vec2 sampleSE;
|
||||
|
||||
/*
|
||||
Based on
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
#ifdef USE_ARRAY_TEXTURE
|
||||
uniform sampler2DArray baseTexture;
|
||||
uniform mediump sampler2DArray baseTexture;
|
||||
#else
|
||||
uniform sampler2D baseTexture;
|
||||
#endif
|
||||
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vPosition;
|
||||
#ifdef GL_ES
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
varying float varTexLayer;
|
||||
#else
|
||||
centroid varying vec4 varColor;
|
||||
centroid varying vec2 varTexCoord;
|
||||
centroid varying float varTexLayer; // actually int
|
||||
#endif
|
||||
VARYING_ vec3 vNormal;
|
||||
VARYING_ vec3 vPosition;
|
||||
CENTROID_ VARYING_ lowp vec4 varColor;
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
CENTROID_ VARYING_ float varTexLayer; // actually int
|
||||
|
||||
|
||||
void main(void)
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vPosition;
|
||||
#ifdef GL_ES
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
varying float varTexLayer;
|
||||
#else
|
||||
centroid varying vec4 varColor;
|
||||
centroid varying vec2 varTexCoord;
|
||||
centroid varying float varTexLayer; // actually int
|
||||
#endif
|
||||
VARYING_ vec3 vNormal;
|
||||
VARYING_ vec3 vPosition;
|
||||
CENTROID_ VARYING_ lowp vec4 varColor;
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
CENTROID_ VARYING_ float varTexLayer; // actually int
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -2,8 +2,8 @@ uniform sampler2D baseTexture;
|
||||
uniform sampler2D normalTexture;
|
||||
uniform vec3 yawVec;
|
||||
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
VARYING_ lowp vec4 varColor;
|
||||
VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
uniform mat4 mWorld;
|
||||
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
VARYING_ lowp vec4 varColor;
|
||||
VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifdef USE_ARRAY_TEXTURE
|
||||
uniform sampler2DArray baseTexture;
|
||||
uniform mediump sampler2DArray baseTexture;
|
||||
#else
|
||||
uniform sampler2D baseTexture;
|
||||
#endif
|
||||
@@ -33,34 +33,27 @@ uniform float crackTextureScale;
|
||||
uniform float xyPerspectiveBias1;
|
||||
uniform vec3 shadow_tint;
|
||||
|
||||
varying float adj_shadow_strength;
|
||||
varying float cosLight;
|
||||
varying float f_normal_length;
|
||||
varying vec3 shadow_position;
|
||||
varying float perspective_factor;
|
||||
VARYING_ float adj_shadow_strength;
|
||||
VARYING_ float cosLight;
|
||||
VARYING_ float f_normal_length;
|
||||
VARYING_ vec3 shadow_position;
|
||||
VARYING_ float perspective_factor;
|
||||
#endif
|
||||
|
||||
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vPosition;
|
||||
VARYING_ vec3 vNormal;
|
||||
VARYING_ vec3 vPosition;
|
||||
// World position in the visible world (i.e. relative to the cameraOffset.)
|
||||
// This can be used for many shader effects without loss of precision.
|
||||
// If the absolute position is required it can be calculated with
|
||||
// cameraOffset + worldPosition (for large coordinates the limits of float
|
||||
// precision must be considered).
|
||||
varying vec3 worldPosition;
|
||||
#ifdef GL_ES
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
varying float varTexLayer;
|
||||
varying float nightRatio;
|
||||
#else
|
||||
centroid varying lowp vec4 varColor;
|
||||
centroid varying vec2 varTexCoord;
|
||||
centroid varying float varTexLayer; // actually int
|
||||
centroid varying float nightRatio;
|
||||
#endif
|
||||
varying highp vec3 eyeVec;
|
||||
VARYING_ vec3 worldPosition;
|
||||
CENTROID_ VARYING_ lowp vec4 varColor;
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
CENTROID_ VARYING_ float varTexLayer; // actually int
|
||||
CENTROID_ VARYING_ float nightRatio;
|
||||
VARYING_ highp vec3 eyeVec;
|
||||
|
||||
#ifdef ENABLE_DYNAMIC_SHADOWS
|
||||
#if (defined(ENABLE_WATER_REFLECTIONS) && MATERIAL_WATER_REFLECTIONS && ENABLE_WAVING_WATER)
|
||||
|
||||
@@ -6,28 +6,22 @@ uniform vec3 dayLight;
|
||||
uniform highp vec3 cameraOffset;
|
||||
uniform float animationTimer;
|
||||
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vPosition;
|
||||
VARYING_ vec3 vNormal;
|
||||
VARYING_ vec3 vPosition;
|
||||
// World position in the visible world (i.e. relative to the cameraOffset.)
|
||||
// This can be used for many shader effects without loss of precision.
|
||||
// If the absolute position is required it can be calculated with
|
||||
// cameraOffset + worldPosition (for large coordinates the limits of float
|
||||
// precision must be considered).
|
||||
varying vec3 worldPosition;
|
||||
VARYING_ vec3 worldPosition;
|
||||
// The centroid keyword ensures that after interpolation the texture coordinates
|
||||
// lie within the same bounds when MSAA is en- and disabled.
|
||||
// lie within the same bounds when MSAA is en- or disabled.
|
||||
// This fixes the stripes problem with nearest-neighbor textures and MSAA.
|
||||
#ifdef GL_ES
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
varying float varTexLayer;
|
||||
varying float nightRatio;
|
||||
#else
|
||||
centroid varying vec4 varColor;
|
||||
centroid varying vec2 varTexCoord;
|
||||
centroid varying float varTexLayer; // actually int
|
||||
centroid varying float nightRatio;
|
||||
#endif
|
||||
CENTROID_ VARYING_ lowp vec4 varColor;
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
CENTROID_ VARYING_ float varTexLayer; // actually int
|
||||
CENTROID_ VARYING_ float nightRatio;
|
||||
|
||||
#ifdef ENABLE_DYNAMIC_SHADOWS
|
||||
// shadow uniforms
|
||||
uniform vec3 v_LightDirection;
|
||||
@@ -38,15 +32,15 @@ centroid varying float nightRatio;
|
||||
uniform float f_timeofday;
|
||||
uniform vec4 CameraPos;
|
||||
|
||||
varying float cosLight;
|
||||
varying float normalOffsetScale;
|
||||
varying float adj_shadow_strength;
|
||||
varying float f_normal_length;
|
||||
varying vec3 shadow_position;
|
||||
varying float perspective_factor;
|
||||
VARYING_ float cosLight;
|
||||
VARYING_ float normalOffsetScale;
|
||||
VARYING_ float adj_shadow_strength;
|
||||
VARYING_ float f_normal_length;
|
||||
VARYING_ vec3 shadow_position;
|
||||
VARYING_ float perspective_factor;
|
||||
#endif
|
||||
|
||||
varying highp vec3 eyeVec;
|
||||
VARYING_ highp vec3 eyeVec;
|
||||
// Color of the light emitted by the light sources.
|
||||
const vec3 artificialLight = vec3(1.04, 1.04, 1.04);
|
||||
const float e = 2.718281828459;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifdef USE_ARRAY_TEXTURE
|
||||
uniform sampler2DArray baseTexture;
|
||||
uniform mediump sampler2DArray baseTexture;
|
||||
#else
|
||||
uniform sampler2D baseTexture;
|
||||
#endif
|
||||
@@ -26,34 +26,29 @@ uniform float animationTimer;
|
||||
uniform float xyPerspectiveBias1;
|
||||
uniform vec3 shadow_tint;
|
||||
|
||||
varying float adj_shadow_strength;
|
||||
varying float cosLight;
|
||||
varying float f_normal_length;
|
||||
varying vec3 shadow_position;
|
||||
varying float perspective_factor;
|
||||
VARYING_ float adj_shadow_strength;
|
||||
VARYING_ float cosLight;
|
||||
VARYING_ float f_normal_length;
|
||||
VARYING_ vec3 shadow_position;
|
||||
VARYING_ float perspective_factor;
|
||||
#endif
|
||||
|
||||
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vPosition;
|
||||
VARYING_ vec3 vNormal;
|
||||
VARYING_ vec3 vPosition;
|
||||
// World position in the visible world (i.e. relative to the cameraOffset.)
|
||||
// This can be used for many shader effects without loss of precision.
|
||||
// If the absolute position is required it can be calculated with
|
||||
// cameraOffset + worldPosition (for large coordinates the limits of float
|
||||
// precision must be considered).
|
||||
varying vec3 worldPosition;
|
||||
varying lowp vec4 varColor;
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
varying float varTexLayer;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
centroid varying float varTexLayer; // actually int
|
||||
#endif
|
||||
varying highp vec3 eyeVec;
|
||||
varying float nightRatio;
|
||||
VARYING_ vec3 worldPosition;
|
||||
VARYING_ lowp vec4 varColor;
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
CENTROID_ VARYING_ float varTexLayer; // actually int
|
||||
VARYING_ highp vec3 eyeVec;
|
||||
VARYING_ float nightRatio;
|
||||
|
||||
varying float vIDiff;
|
||||
VARYING_ float vIDiff;
|
||||
|
||||
#ifdef ENABLE_DYNAMIC_SHADOWS
|
||||
|
||||
@@ -467,5 +462,5 @@ void main(void)
|
||||
col = mix(fogColor * pow(fogColor / fogColorMax, vec4(2.0 * clarity)), col, clarity);
|
||||
col = vec4(col.rgb, base.a);
|
||||
|
||||
gl_FragData[0] = col;
|
||||
gl_FragColor = col;
|
||||
}
|
||||
|
||||
@@ -3,17 +3,12 @@ uniform vec3 dayLight;
|
||||
uniform float animationTimer;
|
||||
uniform lowp vec4 materialColor;
|
||||
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vPosition;
|
||||
varying vec3 worldPosition;
|
||||
varying lowp vec4 varColor;
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
varying float varTexLayer;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
centroid varying float varTexLayer; // actually int
|
||||
#endif
|
||||
VARYING_ vec3 vNormal;
|
||||
VARYING_ vec3 vPosition;
|
||||
VARYING_ vec3 worldPosition;
|
||||
VARYING_ lowp vec4 varColor;
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
CENTROID_ VARYING_ float varTexLayer; // actually int
|
||||
|
||||
#ifdef ENABLE_DYNAMIC_SHADOWS
|
||||
// shadow uniforms
|
||||
@@ -25,18 +20,18 @@ centroid varying float varTexLayer; // actually int
|
||||
uniform float f_timeofday;
|
||||
uniform vec4 CameraPos;
|
||||
|
||||
varying float cosLight;
|
||||
varying float adj_shadow_strength;
|
||||
varying float f_normal_length;
|
||||
varying vec3 shadow_position;
|
||||
varying float perspective_factor;
|
||||
VARYING_ float cosLight;
|
||||
VARYING_ float adj_shadow_strength;
|
||||
VARYING_ float f_normal_length;
|
||||
VARYING_ vec3 shadow_position;
|
||||
VARYING_ float perspective_factor;
|
||||
#endif
|
||||
|
||||
varying highp vec3 eyeVec;
|
||||
varying float nightRatio;
|
||||
VARYING_ highp vec3 eyeVec;
|
||||
VARYING_ float nightRatio;
|
||||
// Color of the light emitted by the light sources.
|
||||
const vec3 artificialLight = vec3(1.04, 1.04, 1.04);
|
||||
varying float vIDiff;
|
||||
VARYING_ float vIDiff;
|
||||
const float e = 2.718281828459;
|
||||
const float BS = 10.0;
|
||||
uniform float xyPerspectiveBias0;
|
||||
|
||||
@@ -21,14 +21,10 @@ uniform ExposureParams exposureParams;
|
||||
uniform lowp float bloomIntensity;
|
||||
uniform lowp float saturation;
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
#ifdef ENABLE_AUTO_EXPOSURE
|
||||
varying float exposure; // linear exposure factor, see vertex shader
|
||||
VARYING_ float exposure; // linear exposure factor, see vertex shader
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_BLOOM
|
||||
|
||||
@@ -3,14 +3,10 @@
|
||||
|
||||
uniform sampler2D exposureMap;
|
||||
|
||||
varying float exposure;
|
||||
VARYING_ float exposure;
|
||||
#endif
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
uniform sampler2D baseTexture;
|
||||
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
VARYING_ lowp vec4 varColor;
|
||||
VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec2 uv = varTexCoord.st;
|
||||
vec4 color = texture2D(baseTexture, uv);
|
||||
color.rgb *= varColor.rgb;
|
||||
gl_FragData[0] = color;
|
||||
fragColor = color;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
varying lowp vec4 varColor;
|
||||
varying mediump vec2 varTexCoord;
|
||||
VARYING_ lowp vec4 varColor;
|
||||
VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
|
||||
void main(void)
|
||||
{
|
||||
varTexCoord.st = inTexCoord0.st;
|
||||
gl_Position = inVertexPosition;
|
||||
}
|
||||
|
||||
@@ -18,11 +18,7 @@ uniform vec3 v_LightDirection;
|
||||
const vec3 v_LightDirection = vec3(0.0, -1.0, 0.0);
|
||||
#endif
|
||||
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
const float far = 1000.;
|
||||
float mapDepth(float depth)
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
#ifdef GL_ES
|
||||
varying mediump vec2 varTexCoord;
|
||||
#else
|
||||
centroid varying vec2 varTexCoord;
|
||||
#endif
|
||||
|
||||
CENTROID_ VARYING_ mediump vec2 varTexCoord;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user