X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=render.h;h=751ca1ba54bb9f60e9847697548dcfd75409919e;hb=1d06671f87a9d24596fc6808d8e0db889a818750;hp=a80f78acff6048e8655d6bff56b9f9237972f2c2;hpb=c34dde859968ced3dc7e8dd7be29f676689813d3;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/render.h b/render.h index a80f78a..751ca1b 100644 --- a/render.h +++ b/render.h @@ -11,21 +11,16 @@ #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 +static f32 k_render_scale = 1.0f; +static i32 k_blur_effect = 1; +static f32 k_blur_strength = 0.3f; +static f32 k_fov = 0.86f; + typedef struct framebuffer framebuffer; /* @@ -36,13 +31,11 @@ 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, - water_render_scale; } -gpipeline = { .view_render_scale = 1.0f }; +gpipeline; struct framebuffer{ const char *display_name; @@ -175,6 +168,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 + } + } } }; @@ -219,8 +233,8 @@ VG_STATIC void render_fb_bind( framebuffer *fb, int use_scaling ) render_fb_get_current_res( fb, &x, &y ); if( use_scaling ){ - x = gpipeline.view_render_scale*(float)x; - y = gpipeline.view_render_scale*(float)y; + x = k_render_scale*(float)x; + y = k_render_scale*(float)y; x = VG_MAX( 16, x ); y = VG_MAX( 16, y ); @@ -489,8 +503,7 @@ VG_STATIC void render_fb_allocate( struct framebuffer *fb ) */ VG_STATIC void render_fb_resize(void) { - if( !gpipeline.ready ) - return; + if( !gpipeline.ready ) return; for( int i=0; i