('ent_swspreview', 'Workshop Preview', '', 14 ),
('ent_menuitem', 'Menu Item', '', 15 ),
('ent_worldinfo', 'World Info', '', 16 ),
- ('ent_ccmd', 'CCmd', '', 17 )
+ ('ent_ccmd', 'CCmd', '', 17 ),
+ ('ent_challenge', 'Challenge', '', 18 )
]
def get_entity_enum_id( alias ):
_fields_ = [("pstr_command",c_uint32)]
#}
+class ent_challenge(Structure):#{
+ _fields_ = [("transform",mdl_transform),
+ ("submesh_start",c_uint32), ("submesh_count",c_uint32),
+ ("id_next",c_uint32),
+ ("filter",c_uint32)]
+#}
+
def obj_ent_type( obj ):
#{
if obj.type == 'ARMATURE': return 'mdl_armature'
yield from _recurse_bone( b )
#}
-def sr_entity_id( obj ):
-#{
+def sr_entity_id( obj ):#{
+ if not obj: return 0
+
tipo = get_entity_enum_id( obj_ent_type(obj) )
index = sr_compile.entity_ids[ obj.name ]
if ent_type == 'ent_font': continue
if ent_type == 'ent_font_variant': continue
if ent_type == 'ent_menuitem': continue
+ if ent_type == 'ent_challenge': continue
#--------------------------
print( F'[SR] {i: 3}/{mesh_count} {obj.name:<40}', end='\r' )
ccmd.pstr_command = sr_compile_string( obj_data.command )
sr_ent_push( ccmd )
#}
+ elif ent_type == 'ent_challenge':#{
+ challenge = ent_challenge()
+ obj_data = obj.SR_data.ent_challenge[0]
+ challenge.id_next = sr_entity_id( obj_data.proxima )
+
+ compile_obj_transform( obj, challenge.transform )
+ challenge.submesh_start, challenge.submesh_count, _ = \
+ sr_compile_mesh_internal( obj )
+
+ sr_ent_push( challenge )
+ #}
#}
#}
command: bpy.props.StringProperty(name="Command Line")
#}
+class SR_OBJECT_ENT_CHALLENGE(bpy.types.PropertyGroup):#{
+ proxima: bpy.props.PointerProperty( \
+ type=bpy.types.Object, name="Next", \
+ poll=lambda self,obj: sr_filter_ent_type(obj,['ent_challenge']))
+ target: bpy.props.PointerProperty( \
+ type=bpy.types.Object, name="Target", \
+ poll=lambda self,obj: sr_filter_ent_type(obj,\
+ ['ent_audio','ent_ccmd']))
+#}
+
class SR_OBJECT_PROPERTIES(bpy.types.PropertyGroup):
#{
ent_gate: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_GATE)
ent_menuitem: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_MENU_ITEM)
ent_worldinfo: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_WORLD_INFO)
ent_ccmd: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_CCMD)
+ ent_challenge: bpy.props.CollectionProperty(type=SR_OBJECT_ENT_CHALLENGE)
ent_type: bpy.props.EnumProperty(
name="Type",
SR_OBJECT_ENT_FONT,SR_OBJECT_ENT_TRAFFIC,SR_OBJECT_ENT_SKATESHOP,\
SR_OBJECT_ENT_WORKSHOP_PREVIEW,SR_OBJECT_ENT_MENU_ITEM,\
SR_OBJECT_ENT_WORLD_INFO,SR_OBJECT_ENT_CCMD,\
+ SR_OBJECT_ENT_CHALLENGE,\
\
SR_OBJECT_PROPERTIES, SR_LIGHT_PROPERTIES, SR_BONE_PROPERTIES,
SR_MESH_PROPERTIES, SR_MATERIAL_PROPERTIES \
typedef struct ent_swspreview ent_swspreview;
typedef struct ent_worldinfo ent_worldinfo;
typedef struct ent_ccmd ent_ccmd;
+typedef struct ent_challenge ent_challenge;
enum entity_alias{
k_ent_none = 0,
k_ent_swspreview = 14,
k_ent_menuitem = 15,
k_ent_worldinfo = 16,
- k_ent_ccmd = 17
+ k_ent_ccmd = 17,
+ k_ent_challenge = 18
};
static u32 mdl_entity_id_type( u32 entity_id ){
u32 pstr_command;
};
+struct ent_challenge{
+ mdl_transform transform;
+ u32 submesh_start,
+ submesh_count,
+ id_next,
+ filter;
+};
+
typedef struct ent_call ent_call;
struct ent_call{
u32 id, function;
#include "common_scene.glsl"
#include "motion_vectors_fs.glsl"
-void main()
-{
- compute_motion_vectors();
+void main(){
+ oMotionVec = vec2(0.0);
vec4 vsamplemain = texture( uTexMain, aUv );
"\n"
"#line 6 0 \n"
"\n"
-"void main()\n"
-"{\n"
-" compute_motion_vectors();\n"
+"void main(){\n"
+" oMotionVec = vec2(0.0);\n"
"\n"
" vec4 vsamplemain = texture( uTexMain, aUv );\n"
"\n"
camera_finalize( &small_cam );
/* Draw player to window buffer and blend background ontop */
- glBindFramebuffer( GL_FRAMEBUFFER, 0 );
- glViewport( 0,0, vg.window_x, vg.window_y );
player__render( &small_cam, &localplayer );
}
VG_STATIC void render_scene(void){
- render_fb_bind( gpipeline.fb_main, 1 );
- glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
- glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT );
-
/* Draw world */
glEnable( GL_DEPTH_TEST );
skaterift_composite_maincamera();
- render_scene();
+ /* --------------------------------------------------------------------- */
+
+ /* variable res target */
+ render_fb_bind( gpipeline.fb_main, 1 );
+ glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
+ glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT );
+ render_scene();
glEnable( GL_DEPTH_TEST );
- render_player_transparent();
+ /* full res target */
+ glBindFramebuffer( GL_FRAMEBUFFER, 0 );
+ glViewport( 0,0, vg.window_x, vg.window_y );
+
+ render_player_transparent(); /* needs to read the depth buffer before we fuck
+ it up with the oblique rendering inside the
+ portals */
+
+ world_render_challenges( localplayer.viewable_world );
+
+ /* continue with variable rate */
render_scene_gate_subview();
+ /* composite */
present_view_with_post_processing();
+ /* --------------------------------------------------------------------- */
+
/* capture the current resume frame at the very last point */
if( button_down( k_srbind_reset ) ){
if( skaterift.activity == k_skaterift_default ){
ent_marker,
ent_camera,
ent_swspreview,
- ent_ccmd;
+ ent_ccmd,
+ ent_challenge;
ent_gate *rendering_gate;
mdl_load_array( meta, &world->ent_skateshop, "ent_skateshop", heap );
mdl_load_array( meta, &world->ent_swspreview,"ent_swspreview", heap );
mdl_load_array( meta, &world->ent_ccmd, "ent_ccmd", heap );
+ mdl_load_array( meta, &world->ent_challenge, "ent_challenge", heap );
mdl_array_ptr infos;
mdl_load_array( meta, &infos, "ent_worldinfo", vg_mem.scratch );
void (*fn_set_uPvmPrev)( m4x4f pvm );
};
-VG_STATIC void world_render_if( world_instance *world, struct world_pass *pass )
+/* TODO: high level control pass renders. */
+
+VG_STATIC
+void world_render_if( world_instance *world, struct world_pass *pass )
{
for( int i=0; i<world->surface_count; i++ ){
struct world_surface *mat = &world->surfaces[i];
}
}
+VG_STATIC
+void world_render_challenges( world_instance *world ){
+ if( !world ) return;
+
+ shader_scene_fxglow_use();
+ for( u32 i=0; i<mdl_arrcount(&world->ent_challenge); i++ ){
+ ent_challenge *challenge = mdl_arritm(&world->ent_challenge,i);
+
+ m4x3f mmdl;
+ mdl_transform_m4x3( &challenge->transform, mmdl );
+ shader_scene_fxglow_uMdl( mmdl );
+ }
+}
+
VG_STATIC
void world_render_both_stages( world_instance *world, struct world_pass *pass )
{
}
VG_STATIC void render_world_fxglow( world_instance *world, camera *cam ){
- glDrawBuffers( 1, (GLenum[]){ GL_COLOR_ATTACHMENT0 } );
+ //glDrawBuffers( 1, (GLenum[]){ GL_COLOR_ATTACHMENT0 } );
shader_scene_fxglow_use();
shader_scene_fxglow_uTexMain(1);
world_render_both_stages( world, &pass );
glEnable(GL_CULL_FACE);
- glDrawBuffers( 2, (GLenum[]){ GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 } );
+ //glDrawBuffers( 2, (GLenum[]){ GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 } );
}
VG_STATIC void bindpoint_terrain( world_instance *world,