X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.c;h=9e5527bd435928645384b00cb664f3bfb452e9e0;hb=53597f45307d8a2120e3a0bbe71797b216e8750b;hp=a7bb6939c6b5d02b07f76e6c5eb29fd2d997afc1;hpb=f2c3e6ffba0231be14961f0149106cecbade8124;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.c b/world_render.c index a7bb693..9e5527b 100644 --- a/world_render.c +++ b/world_render.c @@ -646,9 +646,16 @@ VG_STATIC void bindpoint_terrain( world_instance *world, shader_scene_terrain_uBlendOffset( mat->info.colour1 ); } -VG_STATIC void bindpoint_none( world_instance *world, - struct world_surface *mat ){ - +VG_STATIC void bindpoint_override( world_instance *world, + struct world_surface *mat ){ + if( mat->info.flags & k_material_flag_collision ){ + shader_scene_override_uAlphatest(0); + } + else{ + glActiveTexture( GL_TEXTURE1 ); + glBindTexture( GL_TEXTURE_2D, world->textures[ mat->info.tex_diffuse ] ); + shader_scene_override_uAlphatest(1); + } } VG_STATIC void render_terrain( world_instance *world, camera *cam ) @@ -914,7 +921,7 @@ void render_world_override_pass( world_instance *world, VG_STATIC void render_world_override( world_instance *world ){ struct world_pass pass = { .cam = &skaterift.cam, - .fn_bind_textures = bindpoint_none, + .fn_bind_textures = bindpoint_override, .fn_set_mdl = shader_scene_override_uMdl, .fn_set_uPvmPrev = shader_scene_override_uPvmPrev, .shader = k_shader_override