return;
render_world_override( dest_world, host_world, global_miniworld.mmdl, cam,
- NULL, 0.0f );
+ NULL, (v4f){-10000.0f,10000.0f,0.0f,0.0f} );
render_world_routes( dest_world, host_world,
global_miniworld.mmdl, cam, 0, 1 );
uniform vec4 uPlayerPos; /* w: distance to uSpawnPos */
uniform vec4 uSpawnPos; /* w: inverse distance to uPlayerPos */
uniform bool uAlphatest;
-uniform float uIsoAmt;
+uniform vec4 uMapInfo; /* x: min, y: max, z: iso line amount */
#include "common_scene.glsl"
#include "motion_vectors_fs.glsl"
float dither = fract( vDither.g / 71.0 ) - 0.5;
float dcam = (-8.0+distance( aCo, uCamera ))/4.0;
- if( min(aCo.y*0.5 + dither, dcam + dither) < 0.51 ) discard;
+ float dy0 = aCo.y - uMapInfo.x;
+ float dy1 = uMapInfo.y - aCo.y;
+
+ if( min(min(dy0,dy1)*0.5, dcam) + dither < 0.51 )
+ discard;
compute_motion_vectors();
vfrag += emit;
- if( uIsoAmt > 0.0 ){
+ if( uMapInfo.z > 0.0 ){
float height = fract( aCo.y * 0.1 );
float lg = 2.0*length(vec2(dFdx(height), dFdy(height)));
- vfrag *= 1.0f+(lg*0.2*uIsoAmt);
+ vfrag *= 1.0f+(lg*0.2*uMapInfo.z);
}
oColour = vec4( vfrag, 1.0 );
"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"
+"uniform vec4 uMapInfo; /* x: min, y: max, z: iso line amount */\n"
"\n"
"#line 1 1 \n"
"// :D\n"
"\n"
" vfrag += emit;\n"
"\n"
-" if( uIsoAmt > 0.0 ){\n"
+" if( uMapInfo.z > 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"
+" vfrag *= 1.0f+(lg*0.2*uMapInfo.z);\n"
" }\n"
"\n"
" oColour = vec4( vfrag, 1.0 );\n"
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_uMapInfo;
static GLuint _uniform_scene_override_g_world_depth;
static GLuint _uniform_scene_override_uLightsArray;
static GLuint _uniform_scene_override_uLightsIndex;
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_uMapInfo(v4f v){
+ glUniform4fv(_uniform_scene_override_uMapInfo,1,v);
}
static void shader_scene_override_g_world_depth(int i){
glUniform1i(_uniform_scene_override_g_world_depth,i);
_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_uMapInfo = glGetUniformLocation( _shader_scene_override.id, "uMapInfo" );
_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" );
m4x3f identity;
m4x3_identity( identity );
render_world_override( world, world, identity, &skaterift.cam,
- respawn_chooser.spawn, 1.0f );
+ respawn_chooser.spawn,
+ (v4f){world->tar_min, world->tar_max, 1.0f, 0.0f});
render_world_routes( world, world, identity, &skaterift.cam, 0, 1 );
return;
}
water;
f64 time;
+ f32 tar_min, tar_max;
/* STD140 */
struct ub_world_lighting{
world->entity_bh = bh_create( world->heap, &bh_system_entity_list, world,
indexed_count, 2 );
+
+ world->tar_min = world->entity_bh->nodes[0].bbx[0][1];
+ world->tar_max = world->entity_bh->nodes[0].bbx[1][1] + 20.0f;
+
+ for( u32 i=0; i<mdl_arrcount(&world->ent_marker); i++ ){
+ ent_marker *marker = mdl_arritm( &world->ent_marker, i );
+
+ if( MDL_CONST_PSTREQ( &world->meta, marker->pstr_alias, "tar_min" ) )
+ world->tar_min = marker->transform.co[1];
+
+ if( MDL_CONST_PSTREQ( &world->meta, marker->pstr_alias, "tar_max" ) )
+ world->tar_max = marker->transform.co[1];
+ }
}
static
world_instance *lighting_source,
m4x3f mmdl,
camera *cam,
- ent_spawn *dest_spawn, f32 iso_amt ){
+ ent_spawn *dest_spawn, v4f map_info ){
struct world_pass pass = {
.cam = cam,
.fn_bind_textures = bindpoint_override,
shader_scene_override_uTexGarbage(0);
shader_scene_override_uTexMain(1);
shader_scene_override_uPv( pass.cam->mtx.pv );
- shader_scene_override_uIsoAmt( iso_amt );
+ shader_scene_override_uMapInfo( map_info );
WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( lighting_source, scene_override );
bind_terrain_noise();
world_instance *lighting_source,
m4x3f mmdl,
camera *cam,
- ent_spawn *dest_spawn, f32 iso_amt );
+ ent_spawn *dest_spawn, v4f map_info );
#define WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( WORLD, SHADER ) \
world_link_lighting_ub( WORLD, _shader_##SHADER.id ); \