diff --git a/MAKE.bat b/MAKE.bat index 99a7dfa..c8ff1c6 100644 --- a/MAKE.bat +++ b/MAKE.bat @@ -555,7 +555,7 @@ set rc=0 if "%1"=="nov4k" set "v4k=no" && goto loop if "%1"=="nodemos" set "demos=no" && goto loop if "%1"=="demos" set "demos=yes" && set "hello=no" && goto loop - if "%1"=="extras" set "extras=yes" && set "demos=yes" && set "hello=no" && goto loop + if "%1"=="extras" set "extras=yes" && set "hello=no" && goto loop if "%1"=="noeditor" set "editor=no" && goto loop if "%1"=="hello" set "hello=yes" && goto loop if "%1"=="editor" set "editor=yes" && set "hello=no"&& goto loop @@ -768,8 +768,10 @@ if "!demos!"=="yes" ( !echo! 00-ui && !cc! !o! 00-ui.exe demos\00-ui.c !import! !args! || set rc=1 !echo! 01-sprite && !cc! !o! 01-sprite.exe demos\01-sprite.c !import! !args! || set rc=1 !echo! 02-ddraw && !cc! !o! 02-ddraw.exe demos\02-ddraw.c !import! !args! || set rc=1 +!echo! 02-frustum && !cc! !o! 02-frustum.exe demos\02-frustum.c !import! !args! || set rc=1 !echo! 03-anims && !cc! !o! 03-anims.exe demos\03-anims.c !import! !args! || set rc=1 !echo! 04-actor && !cc! !o! 04-actor.exe demos\04-actor.c !import! !args! || set rc=1 +!echo! 04-lod && !cc! !o! 04-lod.exe demos\04-lod.c !import! !args! || set rc=1 !echo! 05-scene && !cc! !o! 05-scene.exe demos\05-scene.c !import! !args! || set rc=1 !echo! 06-controller && !cc! !o! 06-controller.exe demos\06-controller.c !import! !args! || set rc=1 !echo! 07-network && !cc! !o! 07-network.exe demos\07-network.c !import! !args! || set rc=1 diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index 0f8d521..bfa7f7a 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -339063,10 +339063,6 @@ void network_rpc_send(unsigned id, const char *cmdline) { #line 1 "v4k_shaders.c" static const char *const fs_0_0_shadowmap_lit = "//" FILELINE "\n" -"// #version 140 // inverse() requires v140\n" -"// FILELINE\n" -"\n" -"\n" "// uniform mat4 view = mat4(1.0);\n" "uniform vec3 lightPos = vec3(1.0);\n" "uniform float doTexture = 1.;\n" @@ -339674,31 +339670,32 @@ static const char *const vs_323444143_16_332_model = "//" FILELINE "\n" " if(!SKINNED) {\n" " objPos = att_position;\n" " v_normal = att_normal;\n" -" } else {\n" -" mat3x4 m = vsBoneMatrix[int(att_indexes.x)] * att_weights.x;\n" -" m += vsBoneMatrix[int(att_indexes.y)] * att_weights.y;\n" -" m += vsBoneMatrix[int(att_indexes.z)] * att_weights.z;\n" -" m += vsBoneMatrix[int(att_indexes.w)] * att_weights.w;\n" -" objPos = vec4(att_position, 1.0) * m;\n" -" \n" -" // blendshapes\n" -" // objPos += evaluate_blend_shape(int(att_vertexindex));\n" -" \n" -" v_normal = vec4(att_normal, 0.0) * m;\n" -" //@todo: tangents\n" -" }\n" +" } else {\n" +" mat3x4 m = vsBoneMatrix[int(att_indexes.x)] * att_weights.x;\n" +" m += vsBoneMatrix[int(att_indexes.y)] * att_weights.y;\n" +" m += vsBoneMatrix[int(att_indexes.z)] * att_weights.z;\n" +" m += vsBoneMatrix[int(att_indexes.w)] * att_weights.w;\n" +" objPos = vec4(att_position, 1.0) * m;\n" " \n" -" // vec3 tangent = att_tangent.xyz;\n" -" // vec3 bitangent = cross(att_normal, att_tangent.xyz) * att_tangent.w;\n" +" // blendshapes\n" +" // objPos += evaluate_blend_shape(int(att_vertexindex));\n" " \n" -" v_normal_ws = normalize(vec3(model * vec4(v_normal, 0.))); // normal to world/model space\n" -" v_normal = normalize(v_normal);\n" -" v_position = att_position;\n" -" v_texcoord = att_texcoord;\n" -" v_color = att_color;\n" -" gl_Position = VP * att_instanced_matrix * vec4( objPos, 1.0 );\n" -" do_shadow();\n" -" }\n"; +" v_normal = vec4(att_normal, 0.0) * m;\n" +" //@todo: tangents\n" +" }\n" +" \n" +" // vec3 tangent = att_tangent.xyz;\n" +" // vec3 bitangent = cross(att_normal, att_tangent.xyz) * att_tangent.w;\n" +" \n" +" v_normal_ws = normalize(vec3(model * vec4(v_normal, 0.))); // normal to world/model space\n" +" v_normal = normalize(v_normal);\n" +" v_position = att_position;\n" +" v_texcoord = att_texcoord;\n" +" v_color = att_color;\n" +" gl_Position = VP * att_instanced_matrix * vec4( objPos, 1.0 );\n" +" do_shadow();\n" +"}\n" +"\n"; static const char *const vs_324_24_sprite = "//" FILELINE "\n" "uniform mat4 u_mvp;\n" diff --git a/engine/shaders/fs_0_0_shadowmap_lit.glsl b/engine/shaders/fs_0_0_shadowmap_lit.glsl index 8a520df..bcacf96 100644 --- a/engine/shaders/fs_0_0_shadowmap_lit.glsl +++ b/engine/shaders/fs_0_0_shadowmap_lit.glsl @@ -1,7 +1,3 @@ -// #version 140 // inverse() requires v140 -// FILELINE - - // uniform mat4 view = mat4(1.0); uniform vec3 lightPos = vec3(1.0); uniform float doTexture = 1.; diff --git a/engine/shaders/vs_323444143_16_332_model.glsl b/engine/shaders/vs_323444143_16_332_model.glsl index e741bc1..addda60 100644 --- a/engine/shaders/vs_323444143_16_332_model.glsl +++ b/engine/shaders/vs_323444143_16_332_model.glsl @@ -87,28 +87,28 @@ void main() { if(!SKINNED) { objPos = att_position; v_normal = att_normal; - } else { - mat3x4 m = vsBoneMatrix[int(att_indexes.x)] * att_weights.x; - m += vsBoneMatrix[int(att_indexes.y)] * att_weights.y; - m += vsBoneMatrix[int(att_indexes.z)] * att_weights.z; - m += vsBoneMatrix[int(att_indexes.w)] * att_weights.w; - objPos = vec4(att_position, 1.0) * m; - - // blendshapes - // objPos += evaluate_blend_shape(int(att_vertexindex)); - - v_normal = vec4(att_normal, 0.0) * m; - //@todo: tangents - } + } else { + mat3x4 m = vsBoneMatrix[int(att_indexes.x)] * att_weights.x; + m += vsBoneMatrix[int(att_indexes.y)] * att_weights.y; + m += vsBoneMatrix[int(att_indexes.z)] * att_weights.z; + m += vsBoneMatrix[int(att_indexes.w)] * att_weights.w; + objPos = vec4(att_position, 1.0) * m; - // vec3 tangent = att_tangent.xyz; - // vec3 bitangent = cross(att_normal, att_tangent.xyz) * att_tangent.w; + // blendshapes + // objPos += evaluate_blend_shape(int(att_vertexindex)); - v_normal_ws = normalize(vec3(model * vec4(v_normal, 0.))); // normal to world/model space - v_normal = normalize(v_normal); - v_position = att_position; - v_texcoord = att_texcoord; - v_color = att_color; - gl_Position = VP * att_instanced_matrix * vec4( objPos, 1.0 ); - do_shadow(); - } \ No newline at end of file + v_normal = vec4(att_normal, 0.0) * m; + //@todo: tangents + } + + // vec3 tangent = att_tangent.xyz; + // vec3 bitangent = cross(att_normal, att_tangent.xyz) * att_tangent.w; + + v_normal_ws = normalize(vec3(model * vec4(v_normal, 0.))); // normal to world/model space + v_normal = normalize(v_normal); + v_position = att_position; + v_texcoord = att_texcoord; + v_color = att_color; + gl_Position = VP * att_instanced_matrix * vec4( objPos, 1.0 ); + do_shadow(); +} diff --git a/engine/split/v4k_shaders.c b/engine/split/v4k_shaders.c index 04dfb2f..b2dab75 100644 --- a/engine/split/v4k_shaders.c +++ b/engine/split/v4k_shaders.c @@ -1,8 +1,4 @@ static const char *const fs_0_0_shadowmap_lit = "//" FILELINE "\n" -"// #version 140 // inverse() requires v140\n" -"// FILELINE\n" -"\n" -"\n" "// uniform mat4 view = mat4(1.0);\n" "uniform vec3 lightPos = vec3(1.0);\n" "uniform float doTexture = 1.;\n" @@ -610,31 +606,32 @@ static const char *const vs_323444143_16_332_model = "//" FILELINE "\n" " if(!SKINNED) {\n" " objPos = att_position;\n" " v_normal = att_normal;\n" -" } else {\n" -" mat3x4 m = vsBoneMatrix[int(att_indexes.x)] * att_weights.x;\n" -" m += vsBoneMatrix[int(att_indexes.y)] * att_weights.y;\n" -" m += vsBoneMatrix[int(att_indexes.z)] * att_weights.z;\n" -" m += vsBoneMatrix[int(att_indexes.w)] * att_weights.w;\n" -" objPos = vec4(att_position, 1.0) * m;\n" -" \n" -" // blendshapes\n" -" // objPos += evaluate_blend_shape(int(att_vertexindex));\n" -" \n" -" v_normal = vec4(att_normal, 0.0) * m;\n" -" //@todo: tangents\n" -" }\n" +" } else {\n" +" mat3x4 m = vsBoneMatrix[int(att_indexes.x)] * att_weights.x;\n" +" m += vsBoneMatrix[int(att_indexes.y)] * att_weights.y;\n" +" m += vsBoneMatrix[int(att_indexes.z)] * att_weights.z;\n" +" m += vsBoneMatrix[int(att_indexes.w)] * att_weights.w;\n" +" objPos = vec4(att_position, 1.0) * m;\n" " \n" -" // vec3 tangent = att_tangent.xyz;\n" -" // vec3 bitangent = cross(att_normal, att_tangent.xyz) * att_tangent.w;\n" +" // blendshapes\n" +" // objPos += evaluate_blend_shape(int(att_vertexindex));\n" " \n" -" v_normal_ws = normalize(vec3(model * vec4(v_normal, 0.))); // normal to world/model space\n" -" v_normal = normalize(v_normal);\n" -" v_position = att_position;\n" -" v_texcoord = att_texcoord;\n" -" v_color = att_color;\n" -" gl_Position = VP * att_instanced_matrix * vec4( objPos, 1.0 );\n" -" do_shadow();\n" -" }\n"; +" v_normal = vec4(att_normal, 0.0) * m;\n" +" //@todo: tangents\n" +" }\n" +" \n" +" // vec3 tangent = att_tangent.xyz;\n" +" // vec3 bitangent = cross(att_normal, att_tangent.xyz) * att_tangent.w;\n" +" \n" +" v_normal_ws = normalize(vec3(model * vec4(v_normal, 0.))); // normal to world/model space\n" +" v_normal = normalize(v_normal);\n" +" v_position = att_position;\n" +" v_texcoord = att_texcoord;\n" +" v_color = att_color;\n" +" gl_Position = VP * att_instanced_matrix * vec4( objPos, 1.0 );\n" +" do_shadow();\n" +"}\n" +"\n"; static const char *const vs_324_24_sprite = "//" FILELINE "\n" "uniform mat4 u_mvp;\n" diff --git a/engine/v4k.c b/engine/v4k.c index 71b6a4c..d49dbe2 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -10138,10 +10138,6 @@ void network_rpc_send(unsigned id, const char *cmdline) { #line 1 "v4k_shaders.c" static const char *const fs_0_0_shadowmap_lit = "//" FILELINE "\n" -"// #version 140 // inverse() requires v140\n" -"// FILELINE\n" -"\n" -"\n" "// uniform mat4 view = mat4(1.0);\n" "uniform vec3 lightPos = vec3(1.0);\n" "uniform float doTexture = 1.;\n" @@ -10749,31 +10745,32 @@ static const char *const vs_323444143_16_332_model = "//" FILELINE "\n" " if(!SKINNED) {\n" " objPos = att_position;\n" " v_normal = att_normal;\n" -" } else {\n" -" mat3x4 m = vsBoneMatrix[int(att_indexes.x)] * att_weights.x;\n" -" m += vsBoneMatrix[int(att_indexes.y)] * att_weights.y;\n" -" m += vsBoneMatrix[int(att_indexes.z)] * att_weights.z;\n" -" m += vsBoneMatrix[int(att_indexes.w)] * att_weights.w;\n" -" objPos = vec4(att_position, 1.0) * m;\n" -" \n" -" // blendshapes\n" -" // objPos += evaluate_blend_shape(int(att_vertexindex));\n" -" \n" -" v_normal = vec4(att_normal, 0.0) * m;\n" -" //@todo: tangents\n" -" }\n" +" } else {\n" +" mat3x4 m = vsBoneMatrix[int(att_indexes.x)] * att_weights.x;\n" +" m += vsBoneMatrix[int(att_indexes.y)] * att_weights.y;\n" +" m += vsBoneMatrix[int(att_indexes.z)] * att_weights.z;\n" +" m += vsBoneMatrix[int(att_indexes.w)] * att_weights.w;\n" +" objPos = vec4(att_position, 1.0) * m;\n" " \n" -" // vec3 tangent = att_tangent.xyz;\n" -" // vec3 bitangent = cross(att_normal, att_tangent.xyz) * att_tangent.w;\n" +" // blendshapes\n" +" // objPos += evaluate_blend_shape(int(att_vertexindex));\n" " \n" -" v_normal_ws = normalize(vec3(model * vec4(v_normal, 0.))); // normal to world/model space\n" -" v_normal = normalize(v_normal);\n" -" v_position = att_position;\n" -" v_texcoord = att_texcoord;\n" -" v_color = att_color;\n" -" gl_Position = VP * att_instanced_matrix * vec4( objPos, 1.0 );\n" -" do_shadow();\n" -" }\n"; +" v_normal = vec4(att_normal, 0.0) * m;\n" +" //@todo: tangents\n" +" }\n" +" \n" +" // vec3 tangent = att_tangent.xyz;\n" +" // vec3 bitangent = cross(att_normal, att_tangent.xyz) * att_tangent.w;\n" +" \n" +" v_normal_ws = normalize(vec3(model * vec4(v_normal, 0.))); // normal to world/model space\n" +" v_normal = normalize(v_normal);\n" +" v_position = att_position;\n" +" v_texcoord = att_texcoord;\n" +" v_color = att_color;\n" +" gl_Position = VP * att_instanced_matrix * vec4( objPos, 1.0 );\n" +" do_shadow();\n" +"}\n" +"\n"; static const char *const vs_324_24_sprite = "//" FILELINE "\n" "uniform mat4 u_mvp;\n" diff --git a/engine/v4k.html b/engine/v4k.html index 35356d3..6b4b336 100644 --- a/engine/v4k.html +++ b/engine/v4k.html @@ -596,7 +596,7 @@ details > summary::-webkit-details-marker { |Version: | 2023.7 | |:--------------|:------------| |Branch: | main | -|Commit: | 22 | +|Commit: | 24 | # [V·4·K 2023.7 ](https://dev.v4.games/zaklaus/v4k)