projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix legacy behaviour for trigger exits
[carveJwlIkooP6JGAAIwe30JlM.git]
/
shaders
/
scene_override.h
diff --git
a/shaders/scene_override.h
b/shaders/scene_override.h
index d9f7be05e25325da8fce29c083345347946d87ee..6ef67c9f589686f2e0c878ab987ac4ef9d5aebfe 100644
(file)
--- a/
shaders/scene_override.h
+++ b/
shaders/scene_override.h
@@
-71,6
+71,7
@@
static struct vg_shader _shader_scene_override = {
"uniform vec4 uPlayerPos; /* w: distance to uSpawnPos */\n"
"uniform vec4 uSpawnPos; /* w: inverse distance to uPlayerPos */\n"
"uniform bool uAlphatest;\n"
"uniform vec4 uPlayerPos; /* w: distance to uSpawnPos */\n"
"uniform vec4 uSpawnPos; /* w: inverse distance to uPlayerPos */\n"
"uniform bool uAlphatest;\n"
+"uniform float uIsoAmt;\n"
"\n"
"#line 1 1 \n"
"// :D\n"
"\n"
"#line 1 1 \n"
"// :D\n"
@@
-439,7
+440,7
@@
static struct vg_shader _shader_scene_override = {
" return world_compute_lighting( diffuse, normal, co, compute_board_shadow() );\n"
"}\n"
"\n"
" return world_compute_lighting( diffuse, normal, co, compute_board_shadow() );\n"
"}\n"
"\n"
-"#line 1
1
0 \n"
+"#line 1
2
0 \n"
"#line 1 2 \n"
"const float k_motion_lerp_amount = 0.01;\n"
"\n"
"#line 1 2 \n"
"const float k_motion_lerp_amount = 0.01;\n"
"\n"
@@
-459,7
+460,7
@@
static struct vg_shader _shader_scene_override = {
" oMotionVec = (vmotion1-vmotion0) * (1.0/k_motion_lerp_amount);\n"
"}\n"
"\n"
" oMotionVec = (vmotion1-vmotion0) * (1.0/k_motion_lerp_amount);\n"
"}\n"
"\n"
-"#line 1
2
0 \n"
+"#line 1
3
0 \n"
"\n"
"vec2 smin( float a, float b, float k ){\n"
" float h = max( k-abs(a-b), 0.0 )/k;\n"
"\n"
"vec2 smin( float a, float b, float k ){\n"
" float h = max( k-abs(a-b), 0.0 )/k;\n"
@@
-515,7
+516,15
@@
static struct vg_shader _shader_scene_override = {
" float d3 = distance(p0,aCo);\n"
" emit += vec3(fract(t*0.2-g_realtime+d3*0.2)*max(0.0,1.0-d3*0.2));\n"
"\n"
" float d3 = distance(p0,aCo);\n"
" emit += vec3(fract(t*0.2-g_realtime+d3*0.2)*max(0.0,1.0-d3*0.2));\n"
"\n"
-" oColour = vec4( vfrag+emit, 1.0 );\n"
+" vfrag += emit;\n"
+"\n"
+" if( uIsoAmt > 0.0 ){\n"
+" float height = fract( aCo.y * 0.1 );\n"
+" float lg = 2.0*length(vec2(dFdx(height), dFdy(height)));\n"
+" vfrag *= 1.0f+(lg*0.2*uIsoAmt);\n"
+" }\n"
+"\n"
+" oColour = vec4( vfrag, 1.0 );\n"
" //oColour = vec4( vfrag, 1.0 );\n"
"}\n"
""},
" //oColour = vec4( vfrag, 1.0 );\n"
"}\n"
""},
@@
-532,6
+541,7
@@
static GLuint _uniform_scene_override_uPlane;
static GLuint _uniform_scene_override_uPlayerPos;
static GLuint _uniform_scene_override_uSpawnPos;
static GLuint _uniform_scene_override_uAlphatest;
static GLuint _uniform_scene_override_uPlayerPos;
static GLuint _uniform_scene_override_uSpawnPos;
static GLuint _uniform_scene_override_uAlphatest;
+static GLuint _uniform_scene_override_uIsoAmt;
static GLuint _uniform_scene_override_g_world_depth;
static GLuint _uniform_scene_override_uLightsArray;
static GLuint _uniform_scene_override_uLightsIndex;
static GLuint _uniform_scene_override_g_world_depth;
static GLuint _uniform_scene_override_uLightsArray;
static GLuint _uniform_scene_override_uLightsIndex;
@@
-568,6
+578,9
@@
static void shader_scene_override_uSpawnPos(v4f v){
static void shader_scene_override_uAlphatest(int b){
glUniform1i(_uniform_scene_override_uAlphatest,b);
}
static void shader_scene_override_uAlphatest(int b){
glUniform1i(_uniform_scene_override_uAlphatest,b);
}
+static void shader_scene_override_uIsoAmt(float f){
+ glUniform1f(_uniform_scene_override_uIsoAmt,f);
+}
static void shader_scene_override_g_world_depth(int i){
glUniform1i(_uniform_scene_override_g_world_depth,i);
}
static void shader_scene_override_g_world_depth(int i){
glUniform1i(_uniform_scene_override_g_world_depth,i);
}
@@
-587,6
+600,7
@@
static void shader_scene_override_link(void){
_uniform_scene_override_uPlayerPos = glGetUniformLocation( _shader_scene_override.id, "uPlayerPos" );
_uniform_scene_override_uSpawnPos = glGetUniformLocation( _shader_scene_override.id, "uSpawnPos" );
_uniform_scene_override_uAlphatest = glGetUniformLocation( _shader_scene_override.id, "uAlphatest" );
_uniform_scene_override_uPlayerPos = glGetUniformLocation( _shader_scene_override.id, "uPlayerPos" );
_uniform_scene_override_uSpawnPos = glGetUniformLocation( _shader_scene_override.id, "uSpawnPos" );
_uniform_scene_override_uAlphatest = glGetUniformLocation( _shader_scene_override.id, "uAlphatest" );
+ _uniform_scene_override_uIsoAmt = glGetUniformLocation( _shader_scene_override.id, "uIsoAmt" );
_uniform_scene_override_g_world_depth = glGetUniformLocation( _shader_scene_override.id, "g_world_depth" );
_uniform_scene_override_uLightsArray = glGetUniformLocation( _shader_scene_override.id, "uLightsArray" );
_uniform_scene_override_uLightsIndex = glGetUniformLocation( _shader_scene_override.id, "uLightsIndex" );
_uniform_scene_override_g_world_depth = glGetUniformLocation( _shader_scene_override.id, "g_world_depth" );
_uniform_scene_override_uLightsArray = glGetUniformLocation( _shader_scene_override.id, "uLightsArray" );
_uniform_scene_override_uLightsIndex = glGetUniformLocation( _shader_scene_override.id, "uLightsIndex" );