projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix major overstep with last commit
[carveJwlIkooP6JGAAIwe30JlM.git]
/
shaders
/
character.h
diff --git
a/shaders/character.h
b/shaders/character.h
index 83fdff36ff5ff1fd1369e0591b7c2cc35fd40857..8265c37ba44489da271579bcb814a364aba59408 100644
(file)
--- a/
shaders/character.h
+++ b/
shaders/character.h
@@
-7,12
+7,14
@@
static struct vg_shader _shader_character = {
.link = shader_character_link,
.vs =
{
.link = shader_character_link,
.vs =
{
-.orig_file = "../shaders/character.vs",
+.orig_file = "../
../
shaders/character.vs",
.static_src =
"layout (location=0) in vec3 a_co;\n"
"layout (location=1) in vec3 a_norm;\n"
.static_src =
"layout (location=0) in vec3 a_co;\n"
"layout (location=1) in vec3 a_norm;\n"
-"layout (location=2) in vec4 a_colour;\n"
-"layout (location=3) in vec2 a_uv;\n"
+"layout (location=2) in vec2 a_uv;\n"
+"layout (location=3) in vec4 a_colour;\n"
+"layout (location=4) in vec4 a_weights;\n"
+"layout (location=5) in ivec4 a_groups;\n"
"\n"
"#line 2 0 \n"
"\n"
"\n"
"#line 2 0 \n"
"\n"
@@
-24,6
+26,7
@@
static struct vg_shader _shader_character = {
"out vec2 aUv;\n"
"out vec3 aNorm;\n"
"out vec3 aCo;\n"
"out vec2 aUv;\n"
"out vec3 aNorm;\n"
"out vec3 aCo;\n"
+"out vec3 aWorldCo;\n"
"out float aOpacity;\n"
"\n"
"void main()\n"
"out float aOpacity;\n"
"\n"
"void main()\n"
@@
-35,13
+38,14
@@
static struct vg_shader _shader_character = {
" aColour = a_colour;\n"
" aUv = a_uv;\n"
" aNorm = mat3(uMdl) * a_norm;\n"
" aColour = a_colour;\n"
" aUv = a_uv;\n"
" aNorm = mat3(uMdl) * a_norm;\n"
-" aCo = world_pos;\n"
+" aWorldCo = world_pos;\n"
+" aCo = a_co;\n"
" aOpacity = max(clip_pos.w*3.0,0.1);// 1.0-(gl_Position.y+0.5)*uOpacity;\n"
"}\n"
""},
.fs =
{
" aOpacity = max(clip_pos.w*3.0,0.1);// 1.0-(gl_Position.y+0.5)*uOpacity;\n"
"}\n"
""},
.fs =
{
-.orig_file = "../shaders/character.fs",
+.orig_file = "../
../
shaders/character.fs",
.static_src =
"out vec4 FragColor;\n"
"\n"
.static_src =
"out vec4 FragColor;\n"
"\n"
@@
-53,6
+57,7
@@
static struct vg_shader _shader_character = {
"in vec2 aUv;\n"
"in vec3 aNorm;\n"
"in vec3 aCo;\n"
"in vec2 aUv;\n"
"in vec3 aNorm;\n"
"in vec3 aCo;\n"
+"in vec3 aWorldCo;\n"
"in float aOpacity;\n"
"\n"
"#line 1 1 \n"
"in float aOpacity;\n"
"\n"
"#line 1 1 \n"
@@
-108,7
+113,7
@@
static struct vg_shader _shader_character = {
"\n"
"float shadow_sample( vec3 vdir )\n"
"{\n"
"\n"
"float shadow_sample( vec3 vdir )\n"
"{\n"
-" vec3 sample_pos = aCo + vdir;\n"
+" vec3 sample_pos = a
World
Co + vdir;\n"
" float height_sample = world_depth_sample( sample_pos );\n"
"\n"
" float fdelta = height_sample - sample_pos.y;\n"
" float height_sample = world_depth_sample( sample_pos );\n"
"\n"
" float fdelta = height_sample - sample_pos.y;\n"
@@
-153,14
+158,14
@@
static struct vg_shader _shader_character = {
" return mix( vfrag, vec3(0.55,0.76,1.0), min( 1.0, dist ) );\n"
"}\n"
"\n"
" return mix( vfrag, vec3(0.55,0.76,1.0), min( 1.0, dist ) );\n"
"}\n"
"\n"
-"#line 1
4
0 \n"
+"#line 1
5
0 \n"
"\n"
"void main()\n"
"{\n"
" vec3 vfrag = texture( uTexMain, aUv ).rgb;\n"
"\n"
" // Lighting\n"
"\n"
"void main()\n"
"{\n"
" vec3 vfrag = texture( uTexMain, aUv ).rgb;\n"
"\n"
" // Lighting\n"
-" vec3 halfview = uCamera - aCo;\n"
+" vec3 halfview = uCamera - a
World
Co;\n"
" float fdist = length( halfview );\n"
" halfview /= fdist;\n"
"\n"
" float fdist = length( halfview );\n"
" halfview /= fdist;\n"
"\n"