X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=render.h;h=6b956de3eb867a8d261057c95dbf5b34e9243ba3;hb=aed3995840d5472275b7bf143efed7c4f9daa358;hp=a4005ddbcec76028b77fd873c6b9b8dca479a7b1;hpb=8c376ed2e4021a18b0a6c6e800109d67ad09d198;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/render.h b/render.h index a4005dd..6b956de 100644 --- a/render.h +++ b/render.h @@ -11,18 +11,8 @@ #include "shaders/blitblur.h" #include "shaders/blitcolour.h" -#if 0 -#include "shaders/standard.h" -#include "shaders/vblend.h" -#endif - -VG_STATIC void render_water_texture( world_instance *world, camera *cam, - int layer_depth ); -VG_STATIC void render_water_surface( world_instance *world, camera *cam ); -VG_STATIC void render_world( world_instance *world, camera *cam, - int layer_depth ); -VG_STATIC void render_world_depth( world_instance *world, camera *cam ); - +#define WORKSHOP_PREVIEW_WIDTH 504 +#define WORKSHOP_PREVIEW_HEIGHT 336 #ifndef RENDER_H #define RENDER_H @@ -36,7 +26,8 @@ VG_STATIC struct pipeline{ framebuffer *fb_main, *fb_water_reflection, - *fb_water_beneath; + *fb_water_beneath, + *fb_workshop_preview; int ready; float view_render_scale, @@ -175,6 +166,27 @@ framebuffers[] = .attachment = GL_DEPTH_STENCIL_ATTACHMENT } } + }, + { + "workshop_preview", + .link = &gpipeline.fb_workshop_preview, + .resolution_div = 0, + .fixed_w = WORKSHOP_PREVIEW_WIDTH, .fixed_h = WORKSHOP_PREVIEW_HEIGHT, + .attachments = + { + { + "colour", k_framebuffer_attachment_type_texture, + .internalformat = GL_RGB, + .format = GL_RGB, + .type = GL_UNSIGNED_BYTE, + .attachment = GL_COLOR_ATTACHMENT0 + }, + { + "depth_stencil", k_framebuffer_attachment_type_renderbuffer, + .internalformat = GL_DEPTH24_STENCIL8, + .attachment = GL_DEPTH_STENCIL_ATTACHMENT + } + } } }; @@ -244,7 +256,7 @@ VG_STATIC void render_fb_bind_texture( framebuffer *fb, if( (at->purpose != k_framebuffer_attachment_type_texture) && (at->purpose != k_framebuffer_attachment_type_texture_depth) ) { - vg_fatal_exit_loop( "illegal operation: bind non-texture framebuffer" + vg_fatal_error( "illegal operation: bind non-texture framebuffer" " attachment to texture slot" ); } @@ -480,7 +492,7 @@ VG_STATIC void render_fb_allocate( struct framebuffer *fb ) vg_error( " status: Generic Error" ); vg_info( "}\n" ); - vg_fatal_exit_loop( "Incomplete framebuffer (see logs)" ); + vg_fatal_error( "Incomplete framebuffer (see logs)" ); } } @@ -503,16 +515,25 @@ VG_STATIC void render_fb_resize(void) VG_STATIC int render_framebuffer_control( int argc, char const *argv[] ); VG_STATIC void render_framebuffer_poll( int argc, char const *argv[] ); -VG_STATIC void render_init_fs_quad(void) + +VG_STATIC void async_render_init( void *payload, u32 size ) { - vg_info( "[render] Allocate quad\n" ); + /* + * Complete Framebuffers + */ + for( int i=0; i