diff --git a/android/app/src/main/assets/pakQ3Q.pk3 b/android/app/src/main/assets/pakQ3Q.pk3 index 8ad914c8..1f27f146 100644 Binary files a/android/app/src/main/assets/pakQ3Q.pk3 and b/android/app/src/main/assets/pakQ3Q.pk3 differ diff --git a/android/app/src/main/cpp/code/cgame/cg_drawtools.c b/android/app/src/main/cpp/code/cgame/cg_drawtools.c index b2952399..feb727ea 100644 --- a/android/app/src/main/cpp/code/cgame/cg_drawtools.c +++ b/android/app/src/main/cpp/code/cgame/cg_drawtools.c @@ -60,12 +60,6 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) { float screenXScale = cgs.screenXScale / 2.75f; float screenYScale = cgs.screenYScale / 2.25f; - const auto depth = (int)trap_Cvar_VariableValue( "vr_hudDepth" ); - int xoffset = 120 - (depth * 20); - if (cg.stereoView == STEREO_RIGHT) { - xoffset *= -1; - } - *x *= screenXScale; *y *= screenYScale; if (hudflags & HUD_FLAGS_DRAWMODEL) @@ -81,7 +75,7 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) { *h *= screenYScale; } - *x += (cg.refdef.width - (640 * screenXScale)) / 2.0f + xoffset; + *x += (cg.refdef.width - (640 * screenXScale)) / 2.0f; *y += (cg.refdef.height - (480 * screenYScale)) / 2.0f - trap_Cvar_VariableValue( "vr_hudYOffset" ); } } diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/dlight_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/dlight_vp.glsl index 1e5a1d1a..a9fe11bb 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/dlight_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/dlight_vp.glsl @@ -12,16 +12,17 @@ uniform float u_Time; uniform vec4 u_Color; +uniform mat4 u_ModelMatrix; + // Uniforms layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +{ + uniform mat4 u_ProjectionMatrix; +}; varying vec2 var_Tex1; varying vec4 var_Color; diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/down4x_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/down4x_vp.glsl index ffce2355..27c0d8a6 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/down4x_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/down4x_vp.glsl @@ -1,16 +1,17 @@ attribute vec3 attr_Position; attribute vec4 attr_TexCoord0; + +uniform mat4 u_ModelMatrix; // Uniforms layout(shared) uniform ViewMatrices { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; + uniform mat4 u_ViewMatrices[NUM_VIEWS]; }; layout(shared) uniform ProjectionMatrix { - uniform highp mat4 u_ProjectionMatrix; + uniform mat4 u_ProjectionMatrix; }; -uniform highp mat4 u_ModelMatrix; varying vec2 var_TexCoords; diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/fogpass_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/fogpass_vp.glsl index 20999ea0..e03c0421 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/fogpass_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/fogpass_vp.glsl @@ -15,6 +15,8 @@ uniform vec4 u_FogDistance; uniform vec4 u_FogDepth; uniform float u_FogEyeT; +uniform mat4 u_ModelMatrix; + #if defined(USE_DEFORM_VERTEXES) uniform int u_DeformGen; uniform float u_DeformParams[5]; @@ -22,17 +24,6 @@ uniform float u_DeformParams[5]; uniform float u_Time; -// Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; - #if defined(USE_VERTEX_ANIMATION) uniform float u_VertexLerp; #elif defined(USE_BONE_ANIMATION) @@ -41,6 +32,16 @@ uniform mat4 u_BoneMatrix[MAX_GLSL_BONES]; uniform vec4 u_Color; +// Uniforms +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + varying float var_Scale; #if defined(USE_DEFORM_VERTEXES) diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/generic_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/generic_vp.glsl index f4664ec6..e03f1400 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/generic_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/generic_vp.glsl @@ -36,6 +36,8 @@ uniform float u_FogEyeT; uniform vec4 u_FogColorMask; #endif +uniform mat4 u_ModelMatrix; + #if defined(USE_DEFORM_VERTEXES) uniform int u_DeformGen; uniform float u_DeformParams[5]; @@ -43,17 +45,6 @@ uniform float u_Time; #endif -// Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; - uniform vec4 u_BaseColor; uniform vec4 u_VertColor; @@ -72,6 +63,16 @@ uniform float u_VertexLerp; uniform mat4 u_BoneMatrix[MAX_GLSL_BONES]; #endif +// Uniforms +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + varying vec2 var_DiffuseTex; varying vec4 var_Color; diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/lightall_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/lightall_vp.glsl index e4110f72..ce6d1372 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/lightall_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/lightall_vp.glsl @@ -42,16 +42,7 @@ uniform vec4 u_DiffuseTexOffTurb; #endif -// Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +uniform mat4 u_ModelMatrix; uniform vec4 u_BaseColor; uniform vec4 u_VertColor; @@ -75,6 +66,16 @@ uniform vec4 u_PrimaryLightOrigin; uniform float u_PrimaryLightRadius; #endif +// Uniforms +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + varying vec4 var_TexCoords; varying vec4 var_Color; diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/pshadow_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/pshadow_vp.glsl index ab10dd03..98cdd231 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/pshadow_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/pshadow_vp.glsl @@ -1,16 +1,16 @@ attribute vec3 attr_Position; attribute vec3 attr_Normal; -// Uniforms +uniform mat4 u_ModelMatrix; + layout(shared) uniform ViewMatrices { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; + uniform mat4 u_ViewMatrices[NUM_VIEWS]; }; layout(shared) uniform ProjectionMatrix { - uniform highp mat4 u_ProjectionMatrix; + uniform mat4 u_ProjectionMatrix; }; -uniform highp mat4 u_ModelMatrix; varying vec3 var_Position; varying vec3 var_Normal; diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/shadowfill_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/shadowfill_vp.glsl index 770c6d3c..369740cd 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/shadowfill_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/shadowfill_vp.glsl @@ -10,6 +10,9 @@ attribute vec4 attr_BoneIndexes; attribute vec4 attr_BoneWeights; #endif + +// Uniforms + //#if defined(USE_DEFORM_VERTEXES) uniform int u_DeformGen; uniform float u_DeformParams[5]; @@ -17,16 +20,7 @@ uniform float u_DeformParams[5]; uniform float u_Time; -// Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +uniform mat4 u_ModelMatrix; #if defined(USE_VERTEX_ANIMATION) uniform float u_VertexLerp; @@ -34,6 +28,15 @@ uniform float u_VertexLerp; uniform mat4 u_BoneMatrix[MAX_GLSL_BONES]; #endif +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + varying vec3 var_Position; vec3 DeformPosition(const vec3 pos, const vec3 normal, const vec2 st) diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/texturecolor_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/texturecolor_vp.glsl index 16269fba..b844be3b 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/texturecolor_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/texturecolor_vp.glsl @@ -1,18 +1,18 @@ attribute vec3 attr_Position; attribute vec4 attr_TexCoord0; - // Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +uniform mat4 u_ModelMatrix; + +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; varying vec2 var_Tex1; diff --git a/android/app/src/main/cpp/code/renderergl2/glsl/tonemap_vp.glsl b/android/app/src/main/cpp/code/renderergl2/glsl/tonemap_vp.glsl index 88b21508..77188c43 100644 --- a/android/app/src/main/cpp/code/renderergl2/glsl/tonemap_vp.glsl +++ b/android/app/src/main/cpp/code/renderergl2/glsl/tonemap_vp.glsl @@ -1,20 +1,21 @@ attribute vec3 attr_Position; attribute vec4 attr_TexCoord0; - // Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +uniform mat4 u_ModelMatrix; uniform vec3 u_ToneMinAvgMaxLinear; +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + + varying vec2 var_TexCoords; varying float var_InvWhite; diff --git a/android/app/src/main/cpp/code/renderergl2/tr_glsl.c b/android/app/src/main/cpp/code/renderergl2/tr_glsl.c index 85e8a38c..086878ec 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_glsl.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_glsl.c @@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "tr_local.h" #include "tr_dsa.h" +#include "../vr/vr_base.h" extern const char *fallbackShader_bokeh_vp; @@ -54,6 +55,8 @@ extern const char *fallbackShader_texturecolor_fp; extern const char *fallbackShader_tonemap_vp; extern const char *fallbackShader_tonemap_fp; +extern cvar_t *vr_hudDepth; + typedef struct uniformInfo_s { char *name; @@ -193,9 +196,16 @@ static void GLSL_ViewMatricesUniformBuffer(const float value[32]) { if (i == ORTHO_PROJECTION) { + //don't want depth when in screen view + const auto depth = VR_useScreenLayer() ? 0 : (5-vr_hudDepth->integer) * 20; + //For now just set identity matrices - Mat4Identity(viewMatrices); - Mat4Identity(viewMatrices + 16); + vec3_t translate; + VectorSet(translate, depth, 0, 0); + Mat4Translation( translate, viewMatrices ); + + VectorSet(translate, -depth, 0, 0); + Mat4Translation( translate, viewMatrices + 16 ); } else { @@ -327,9 +337,9 @@ static void GLSL_GetShaderHeader( GLenum shaderType, const GLchar *extra, char * } // HACK: use in main menu medium float precision (to prevent issue with missing models textures) - if (Cvar_Get("r_uiFullScreen", "1", 0)->integer) - Q_strcat(dest, size, "precision mediump float;\n"); - else +// if (Cvar_Get("r_uiFullScreen", "1", 0)->integer) +// Q_strcat(dest, size, "precision mediump float;\n"); +// else Q_strcat(dest, size, "precision highp float;\n"); if(shaderType == GL_VERTEX_SHADER) @@ -1652,40 +1662,16 @@ void GLSL_PrepareUniformBuffers(void) height = glConfig.vidHeight; } - static qboolean first = qtrue; - static float defaultProjection[16]; - if (first) - { - first = qfalse; - memset(defaultProjection, 0, 16 * sizeof(float)); - } + float orthoProjectionMatrix[16]; + Mat4Ortho(0, width, height, 0, 0, 1, orthoProjectionMatrix); - static int vidWidth = 1; - static int vidHeight = 1; - if (vidWidth != width || vidHeight != height) - { + //ortho projection matrix + GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[ORTHO_PROJECTION], + orthoProjectionMatrix); - float orthoProjectionMatrix[16]; - Mat4Ortho(0, vidWidth, vidHeight, 0, 0, 1, orthoProjectionMatrix); - - //ortho projection matrix - GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[ORTHO_PROJECTION], - orthoProjectionMatrix); - - vidWidth = width; - vidHeight = height; - } - - //We only need to do the following if the default projection changes - if (memcmp(defaultProjection, tr.vrParms.projection, 16 * sizeof(float)) != 0) - { - //Take a copy of the default projection - memcpy(defaultProjection, tr.vrParms.projection, 16 * sizeof(float)); - - //unadjusted projection matrix - GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[NORMAL_PROJECTION], - tr.vrParms.projection); - } + //VR projection matrix + GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[NORMAL_PROJECTION], + tr.vrParms.projection); //Set up the buffers that won't change this frame GLSL_ViewMatricesUniformBuffer(tr.viewParms.world.eyeViewMatrix); @@ -1704,7 +1690,6 @@ void GLSL_BindProgram(shaderProgram_t * program) if (GL_UseProgram(programObject)) backEnd.pc.c_glslShaderBinds++; - } static GLuint GLSL_CalculateProjection() { diff --git a/android/app/src/main/pakQ3Q/glsl/dlight_vp.glsl b/android/app/src/main/pakQ3Q/glsl/dlight_vp.glsl index 1e5a1d1a..a9fe11bb 100644 --- a/android/app/src/main/pakQ3Q/glsl/dlight_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/dlight_vp.glsl @@ -12,16 +12,17 @@ uniform float u_Time; uniform vec4 u_Color; +uniform mat4 u_ModelMatrix; + // Uniforms layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +{ + uniform mat4 u_ProjectionMatrix; +}; varying vec2 var_Tex1; varying vec4 var_Color; diff --git a/android/app/src/main/pakQ3Q/glsl/down4x_vp.glsl b/android/app/src/main/pakQ3Q/glsl/down4x_vp.glsl index ffce2355..27c0d8a6 100644 --- a/android/app/src/main/pakQ3Q/glsl/down4x_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/down4x_vp.glsl @@ -1,16 +1,17 @@ attribute vec3 attr_Position; attribute vec4 attr_TexCoord0; + +uniform mat4 u_ModelMatrix; // Uniforms layout(shared) uniform ViewMatrices { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; + uniform mat4 u_ViewMatrices[NUM_VIEWS]; }; layout(shared) uniform ProjectionMatrix { - uniform highp mat4 u_ProjectionMatrix; + uniform mat4 u_ProjectionMatrix; }; -uniform highp mat4 u_ModelMatrix; varying vec2 var_TexCoords; diff --git a/android/app/src/main/pakQ3Q/glsl/fogpass_vp.glsl b/android/app/src/main/pakQ3Q/glsl/fogpass_vp.glsl index 20999ea0..e03c0421 100644 --- a/android/app/src/main/pakQ3Q/glsl/fogpass_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/fogpass_vp.glsl @@ -15,6 +15,8 @@ uniform vec4 u_FogDistance; uniform vec4 u_FogDepth; uniform float u_FogEyeT; +uniform mat4 u_ModelMatrix; + #if defined(USE_DEFORM_VERTEXES) uniform int u_DeformGen; uniform float u_DeformParams[5]; @@ -22,17 +24,6 @@ uniform float u_DeformParams[5]; uniform float u_Time; -// Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; - #if defined(USE_VERTEX_ANIMATION) uniform float u_VertexLerp; #elif defined(USE_BONE_ANIMATION) @@ -41,6 +32,16 @@ uniform mat4 u_BoneMatrix[MAX_GLSL_BONES]; uniform vec4 u_Color; +// Uniforms +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + varying float var_Scale; #if defined(USE_DEFORM_VERTEXES) diff --git a/android/app/src/main/pakQ3Q/glsl/generic_vp.glsl b/android/app/src/main/pakQ3Q/glsl/generic_vp.glsl index f4664ec6..e03f1400 100644 --- a/android/app/src/main/pakQ3Q/glsl/generic_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/generic_vp.glsl @@ -36,6 +36,8 @@ uniform float u_FogEyeT; uniform vec4 u_FogColorMask; #endif +uniform mat4 u_ModelMatrix; + #if defined(USE_DEFORM_VERTEXES) uniform int u_DeformGen; uniform float u_DeformParams[5]; @@ -43,17 +45,6 @@ uniform float u_Time; #endif -// Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; - uniform vec4 u_BaseColor; uniform vec4 u_VertColor; @@ -72,6 +63,16 @@ uniform float u_VertexLerp; uniform mat4 u_BoneMatrix[MAX_GLSL_BONES]; #endif +// Uniforms +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + varying vec2 var_DiffuseTex; varying vec4 var_Color; diff --git a/android/app/src/main/pakQ3Q/glsl/lightall_vp.glsl b/android/app/src/main/pakQ3Q/glsl/lightall_vp.glsl index e4110f72..ce6d1372 100644 --- a/android/app/src/main/pakQ3Q/glsl/lightall_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/lightall_vp.glsl @@ -42,16 +42,7 @@ uniform vec4 u_DiffuseTexOffTurb; #endif -// Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +uniform mat4 u_ModelMatrix; uniform vec4 u_BaseColor; uniform vec4 u_VertColor; @@ -75,6 +66,16 @@ uniform vec4 u_PrimaryLightOrigin; uniform float u_PrimaryLightRadius; #endif +// Uniforms +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + varying vec4 var_TexCoords; varying vec4 var_Color; diff --git a/android/app/src/main/pakQ3Q/glsl/pshadow_vp.glsl b/android/app/src/main/pakQ3Q/glsl/pshadow_vp.glsl index ab10dd03..98cdd231 100644 --- a/android/app/src/main/pakQ3Q/glsl/pshadow_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/pshadow_vp.glsl @@ -1,16 +1,16 @@ attribute vec3 attr_Position; attribute vec3 attr_Normal; -// Uniforms +uniform mat4 u_ModelMatrix; + layout(shared) uniform ViewMatrices { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; + uniform mat4 u_ViewMatrices[NUM_VIEWS]; }; layout(shared) uniform ProjectionMatrix { - uniform highp mat4 u_ProjectionMatrix; + uniform mat4 u_ProjectionMatrix; }; -uniform highp mat4 u_ModelMatrix; varying vec3 var_Position; varying vec3 var_Normal; diff --git a/android/app/src/main/pakQ3Q/glsl/shadowfill_vp.glsl b/android/app/src/main/pakQ3Q/glsl/shadowfill_vp.glsl index 770c6d3c..369740cd 100644 --- a/android/app/src/main/pakQ3Q/glsl/shadowfill_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/shadowfill_vp.glsl @@ -10,6 +10,9 @@ attribute vec4 attr_BoneIndexes; attribute vec4 attr_BoneWeights; #endif + +// Uniforms + //#if defined(USE_DEFORM_VERTEXES) uniform int u_DeformGen; uniform float u_DeformParams[5]; @@ -17,16 +20,7 @@ uniform float u_DeformParams[5]; uniform float u_Time; -// Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +uniform mat4 u_ModelMatrix; #if defined(USE_VERTEX_ANIMATION) uniform float u_VertexLerp; @@ -34,6 +28,15 @@ uniform float u_VertexLerp; uniform mat4 u_BoneMatrix[MAX_GLSL_BONES]; #endif +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + varying vec3 var_Position; vec3 DeformPosition(const vec3 pos, const vec3 normal, const vec2 st) diff --git a/android/app/src/main/pakQ3Q/glsl/texturecolor_vp.glsl b/android/app/src/main/pakQ3Q/glsl/texturecolor_vp.glsl index 16269fba..b844be3b 100644 --- a/android/app/src/main/pakQ3Q/glsl/texturecolor_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/texturecolor_vp.glsl @@ -1,18 +1,18 @@ attribute vec3 attr_Position; attribute vec4 attr_TexCoord0; - // Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +uniform mat4 u_ModelMatrix; + +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; varying vec2 var_Tex1; diff --git a/android/app/src/main/pakQ3Q/glsl/tonemap_vp.glsl b/android/app/src/main/pakQ3Q/glsl/tonemap_vp.glsl index 88b21508..77188c43 100644 --- a/android/app/src/main/pakQ3Q/glsl/tonemap_vp.glsl +++ b/android/app/src/main/pakQ3Q/glsl/tonemap_vp.glsl @@ -1,20 +1,21 @@ attribute vec3 attr_Position; attribute vec4 attr_TexCoord0; - // Uniforms -layout(shared) uniform ViewMatrices - { - uniform highp mat4 u_ViewMatrices[NUM_VIEWS]; - }; -layout(shared) uniform ProjectionMatrix - { - uniform highp mat4 u_ProjectionMatrix; - }; -uniform highp mat4 u_ModelMatrix; +uniform mat4 u_ModelMatrix; uniform vec3 u_ToneMinAvgMaxLinear; +layout(shared) uniform ViewMatrices +{ + uniform mat4 u_ViewMatrices[NUM_VIEWS]; +}; +layout(shared) uniform ProjectionMatrix +{ + uniform mat4 u_ProjectionMatrix; +}; + + varying vec2 var_TexCoords; varying float var_InvWhite;