some gles3 code

This commit is contained in:
aap
2020-05-12 21:31:44 +02:00
parent 661feeabf4
commit 2233b12daa
13 changed files with 51 additions and 29 deletions

View File

@@ -1,5 +1,3 @@
#version 330
layout(std140) uniform State
{
int u_alphaTest;
@@ -72,8 +70,8 @@ vec3 DoSpotLight(Light L, vec3 V, vec3 N)
float pcos = dot(dir, L.direction.xyz); // cos to point
float ccos = -L.minusCosAngle;
float falloff = (pcos-ccos)/(1.0-ccos);
if(falloff < 0) // outside of cone
l = 0;
if(falloff < 0.0) // outside of cone
l = 0.0;
l *= max(falloff, L.hardSpot);
return l*L.color.xyz*atten;
}
@@ -85,4 +83,4 @@ float DoFog(float w)
#define DIRECTIONALS
#define POINTLIGHTS
#define SPOTLIGHTS
#define SPOTLIGHTS

View File

@@ -1,6 +1,4 @@
const char *header_vert_src =
"#version 330\n"
"layout(std140) uniform State\n"
"{\n"
" int u_alphaTest;\n"
@@ -73,8 +71,8 @@ const char *header_vert_src =
" float pcos = dot(dir, L.direction.xyz); // cos to point\n"
" float ccos = -L.minusCosAngle;\n"
" float falloff = (pcos-ccos)/(1.0-ccos);\n"
" if(falloff < 0) // outside of cone\n"
" l = 0;\n"
" if(falloff < 0.0) // outside of cone\n"
" l = 0.0;\n"
" l *= max(falloff, L.hardSpot);\n"
" return l*L.color.xyz*atten;\n"
"}\n"
@@ -86,4 +84,5 @@ const char *header_vert_src =
"#define DIRECTIONALS\n"
"#define POINTLIGHTS\n"
"#define SPOTLIGHTS\n";
"#define SPOTLIGHTS\n"
;

View File

@@ -1,5 +1,3 @@
#version 330
layout(std140) uniform State
{
int u_alphaTest;

View File

@@ -53,8 +53,6 @@ const char *matfx_env_vert_src =
"}\n"
;
const char *matfx_env_frag_src =
"#version 330\n"
"layout(std140) uniform State\n"
"{\n"
" int u_alphaTest;\n"
@@ -71,6 +69,7 @@ const char *matfx_env_frag_src =
"uniform sampler2D tex1;\n"
"uniform float u_coefficient;\n"
"uniform vec4 u_colorClamp;\n"
"in vec4 v_color;\n"
"in vec2 v_tex0;\n"

View File

@@ -1,5 +1,3 @@
#version 330
layout(std140) uniform State
{
int u_alphaTest;

View File

@@ -1,6 +1,4 @@
const char *simple_frag_src =
"#version 330\n"
"layout(std140) uniform State\n"
"{\n"
" int u_alphaTest;\n"