"uniform sampler2D uTexSceneDepth;\n"
"uniform vec3 uInverseRatioDepth;\n"
"uniform vec3 uInverseRatioMain;\n"
-"uniform bool uDepthCompare;\n"
+"uniform int uDepthMode;\n"
+"uniform float uDitherCutoff;\n"
"\n"
"float linear_depth( float depth, float near, float far ) {\n"
" float z = depth * 2.0 - 1.0;\n"
" return (2.0 * near * far) / (far + near - z * (far - near)); \n"
"}\n"
"\n"
-"void depth_compare_dither(){\n"
-" if( uDepthCompare ){\n"
+"void depth_compare_dither()\n"
+"{\n"
+" if( uDepthMode == 1 )\n"
+" {\n"
" vec2 back_coord = gl_FragCoord.xy * uInverseRatioMain.xy \n"
" * uInverseRatioDepth.xy;\n"
" float back_depth = texture( uTexSceneDepth, back_coord ).r;\n"
" if( step(0.0,diff)+dither<0.3 )\n"
" discard;\n"
" }\n"
+"\n"
+" if( uDepthMode == 2 )\n"
+" {\n"
+" vec2 ssuv = gl_FragCoord.xy;\n"
+" vec3 vDither = vec3( dot( vec2( 171.0, 231.0 ), ssuv) );\n"
+" float dither = fract( vDither.g / 71.0 );\n"
+" if( dither<uDitherCutoff ) discard;\n"
+" }\n"
"}\n"
"\n"
"#line 14 0 \n"
GLuint _uniform_model_character_view_uTexSceneDepth;
GLuint _uniform_model_character_view_uInverseRatioDepth;
GLuint _uniform_model_character_view_uInverseRatioMain;
-GLuint _uniform_model_character_view_uDepthCompare;
+GLuint _uniform_model_character_view_uDepthMode;
+GLuint _uniform_model_character_view_uDitherCutoff;
#include "shaders/model_board_view.h"
struct vg_shader _shader_model_board_view = {
.name = "model_board_view",
"uniform sampler2D uTexSceneDepth;\n"
"uniform vec3 uInverseRatioDepth;\n"
"uniform vec3 uInverseRatioMain;\n"
-"uniform bool uDepthCompare;\n"
+"uniform int uDepthMode;\n"
+"uniform float uDitherCutoff;\n"
"\n"
"float linear_depth( float depth, float near, float far ) {\n"
" float z = depth * 2.0 - 1.0;\n"
" return (2.0 * near * far) / (far + near - z * (far - near)); \n"
"}\n"
"\n"
-"void depth_compare_dither(){\n"
-" if( uDepthCompare ){\n"
+"void depth_compare_dither()\n"
+"{\n"
+" if( uDepthMode == 1 )\n"
+" {\n"
" vec2 back_coord = gl_FragCoord.xy * uInverseRatioMain.xy \n"
" * uInverseRatioDepth.xy;\n"
" float back_depth = texture( uTexSceneDepth, back_coord ).r;\n"
" if( step(0.0,diff)+dither<0.3 )\n"
" discard;\n"
" }\n"
+"\n"
+" if( uDepthMode == 2 )\n"
+" {\n"
+" vec2 ssuv = gl_FragCoord.xy;\n"
+" vec3 vDither = vec3( dot( vec2( 171.0, 231.0 ), ssuv) );\n"
+" float dither = fract( vDither.g / 71.0 );\n"
+" if( dither<uDitherCutoff ) discard;\n"
+" }\n"
"}\n"
"\n"
"#line 14 0 \n"
GLuint _uniform_model_board_view_uTexSceneDepth;
GLuint _uniform_model_board_view_uInverseRatioDepth;
GLuint _uniform_model_board_view_uInverseRatioMain;
-GLuint _uniform_model_board_view_uDepthCompare;
+GLuint _uniform_model_board_view_uDepthMode;
+GLuint _uniform_model_board_view_uDitherCutoff;
#include "shaders/model_entity.h"
struct vg_shader _shader_model_entity = {
.name = "model_entity",
"uniform sampler2D uTexSceneDepth;\n"
"uniform vec3 uInverseRatioDepth;\n"
"uniform vec3 uInverseRatioMain;\n"
-"uniform bool uDepthCompare;\n"
+"uniform int uDepthMode;\n"
+"uniform float uDitherCutoff;\n"
"\n"
"float linear_depth( float depth, float near, float far ) {\n"
" float z = depth * 2.0 - 1.0;\n"
" return (2.0 * near * far) / (far + near - z * (far - near)); \n"
"}\n"
"\n"
-"void depth_compare_dither(){\n"
-" if( uDepthCompare ){\n"
+"void depth_compare_dither()\n"
+"{\n"
+" if( uDepthMode == 1 )\n"
+" {\n"
" vec2 back_coord = gl_FragCoord.xy * uInverseRatioMain.xy \n"
" * uInverseRatioDepth.xy;\n"
" float back_depth = texture( uTexSceneDepth, back_coord ).r;\n"
" if( step(0.0,diff)+dither<0.3 )\n"
" discard;\n"
" }\n"
+"\n"
+" if( uDepthMode == 2 )\n"
+" {\n"
+" vec2 ssuv = gl_FragCoord.xy;\n"
+" vec3 vDither = vec3( dot( vec2( 171.0, 231.0 ), ssuv) );\n"
+" float dither = fract( vDither.g / 71.0 );\n"
+" if( dither<uDitherCutoff ) discard;\n"
+" }\n"
"}\n"
"\n"
"#line 12 0 \n"
GLuint _uniform_model_font_uTexSceneDepth;
GLuint _uniform_model_font_uInverseRatioDepth;
GLuint _uniform_model_font_uInverseRatioMain;
-GLuint _uniform_model_font_uDepthCompare;
+GLuint _uniform_model_font_uDepthMode;
+GLuint _uniform_model_font_uDitherCutoff;
#include "shaders/particle.h"
struct vg_shader _shader_particle = {
.name = "particle",
_uniform_model_character_view_uTexSceneDepth = glGetUniformLocation( _shader_model_character_view.id, "uTexSceneDepth" );
_uniform_model_character_view_uInverseRatioDepth = glGetUniformLocation( _shader_model_character_view.id, "uInverseRatioDepth" );
_uniform_model_character_view_uInverseRatioMain = glGetUniformLocation( _shader_model_character_view.id, "uInverseRatioMain" );
- _uniform_model_character_view_uDepthCompare = glGetUniformLocation( _shader_model_character_view.id, "uDepthCompare" );
+ _uniform_model_character_view_uDepthMode = glGetUniformLocation( _shader_model_character_view.id, "uDepthMode" );
+ _uniform_model_character_view_uDitherCutoff = glGetUniformLocation( _shader_model_character_view.id, "uDitherCutoff" );
_uniform_model_board_view_uMdl = glGetUniformLocation( _shader_model_board_view.id, "uMdl" );
_uniform_model_board_view_uPv = glGetUniformLocation( _shader_model_board_view.id, "uPv" );
_uniform_model_board_view_uPvmPrev = glGetUniformLocation( _shader_model_board_view.id, "uPvmPrev" );
_uniform_model_board_view_uTexSceneDepth = glGetUniformLocation( _shader_model_board_view.id, "uTexSceneDepth" );
_uniform_model_board_view_uInverseRatioDepth = glGetUniformLocation( _shader_model_board_view.id, "uInverseRatioDepth" );
_uniform_model_board_view_uInverseRatioMain = glGetUniformLocation( _shader_model_board_view.id, "uInverseRatioMain" );
- _uniform_model_board_view_uDepthCompare = glGetUniformLocation( _shader_model_board_view.id, "uDepthCompare" );
+ _uniform_model_board_view_uDepthMode = glGetUniformLocation( _shader_model_board_view.id, "uDepthMode" );
+ _uniform_model_board_view_uDitherCutoff = glGetUniformLocation( _shader_model_board_view.id, "uDitherCutoff" );
_uniform_model_entity_uMdl = glGetUniformLocation( _shader_model_entity.id, "uMdl" );
_uniform_model_entity_uPv = glGetUniformLocation( _shader_model_entity.id, "uPv" );
_uniform_model_entity_uPvmPrev = glGetUniformLocation( _shader_model_entity.id, "uPvmPrev" );
_uniform_model_font_uTexSceneDepth = glGetUniformLocation( _shader_model_font.id, "uTexSceneDepth" );
_uniform_model_font_uInverseRatioDepth = glGetUniformLocation( _shader_model_font.id, "uInverseRatioDepth" );
_uniform_model_font_uInverseRatioMain = glGetUniformLocation( _shader_model_font.id, "uInverseRatioMain" );
- _uniform_model_font_uDepthCompare = glGetUniformLocation( _shader_model_font.id, "uDepthCompare" );
+ _uniform_model_font_uDepthMode = glGetUniformLocation( _shader_model_font.id, "uDepthMode" );
+ _uniform_model_font_uDitherCutoff = glGetUniformLocation( _shader_model_font.id, "uDitherCutoff" );
_uniform_particle_uPv = glGetUniformLocation( _shader_particle.id, "uPv" );
_uniform_particle_uPvPrev = glGetUniformLocation( _shader_particle.id, "uPvPrev" );
_uniform_trail_uPv = glGetUniformLocation( _shader_trail.id, "uPv" );