Skip to content

Commit

Permalink
add version 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
MizunagiKB committed Sep 16, 2024
1 parent 509c993 commit 0cedae6
Show file tree
Hide file tree
Showing 89 changed files with 16,528 additions and 225 deletions.
32 changes: 31 additions & 1 deletion docs-src/modules/ROOT/examples/2d_cubism_mask_add.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,39 @@ uniform vec4 channel;
uniform sampler2D tex_main : filter_linear_mipmap;
uniform sampler2D tex_mask : filter_linear_mipmap;

uniform bool auto_scale;
uniform vec2 canvas_size;
uniform vec2 mask_size;
uniform float ratio;
uniform vec2 adjust_pos;
uniform float adjust_scale;


void vertex() {
UV.y = 1.0 - UV.y;
}

vec2 lookup_mask_uv(vec2 screen_uv) {

if(auto_scale == false) return screen_uv;

vec2 r_uv = screen_uv - 0.5;
vec2 calc_pos;

calc_pos.x = (canvas_size.x * adjust_scale) - canvas_size.x;
calc_pos.x = calc_pos.x * (adjust_pos.x / canvas_size.x);
calc_pos.x = calc_pos.x / canvas_size.x;

calc_pos.y = (canvas_size.y * adjust_scale) - canvas_size.y;
calc_pos.y = calc_pos.y * (adjust_pos.y / canvas_size.y);
calc_pos.y = calc_pos.y / canvas_size.y;

r_uv = r_uv + calc_pos;
r_uv = r_uv * (1.0 / adjust_scale);

return r_uv + 0.5;
}

void fragment() {
vec4 color_tex = texture(tex_main, UV);
color_tex.rgb = color_tex.rgb * color_multiply.rgb;
Expand All @@ -24,7 +53,8 @@ void fragment() {
vec4 color_for_mask = color_tex * color_base;
color_for_mask.rgb = color_for_mask.rgb * color_for_mask.a;

vec4 clip_mask = texture(tex_mask, SCREEN_UV) * channel;
vec4 clip_mask = texture(tex_mask, lookup_mask_uv(SCREEN_UV)) * channel;

float mask_val = clip_mask.r + clip_mask.g + clip_mask.b + clip_mask.a;
color_for_mask.rgb = color_for_mask.rgb * mask_val;
COLOR = vec4(color_for_mask.rgb, 0.0);
Expand Down
34 changes: 32 additions & 2 deletions docs-src/modules/ROOT/examples/2d_cubism_mask_add_inv.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,50 @@ uniform vec4 channel;
uniform sampler2D tex_main : filter_linear_mipmap;
uniform sampler2D tex_mask : filter_linear_mipmap;

uniform bool auto_scale;
uniform vec2 canvas_size;
uniform vec2 mask_size;
uniform float ratio;
uniform vec2 adjust_pos;
uniform float adjust_scale;


void vertex() {
UV.y = 1.0 - UV.y;
}

vec2 lookup_mask_uv(vec2 screen_uv) {

if(auto_scale == false) return screen_uv;

vec2 r_uv = screen_uv - 0.5;
vec2 calc_pos;

calc_pos.x = (canvas_size.x * adjust_scale) - canvas_size.x;
calc_pos.x = calc_pos.x * (adjust_pos.x / canvas_size.x);
calc_pos.x = calc_pos.x / canvas_size.x;

calc_pos.y = (canvas_size.y * adjust_scale) - canvas_size.y;
calc_pos.y = calc_pos.y * (adjust_pos.y / canvas_size.y);
calc_pos.y = calc_pos.y / canvas_size.y;

r_uv = r_uv + calc_pos;
r_uv = r_uv * (1.0 / adjust_scale);

return r_uv + 0.5;
}

void fragment() {
vec4 color_tex = texture(tex_main, UV);
color_tex.rgb = color_tex.rgb * color_multiply.rgb;

// premul alpha
// premul alpha
color_tex.rgb = color_tex.rgb + color_screen.rgb - (color_tex.rgb * color_screen.rgb);
vec4 color_for_mask = color_tex * color_base;
color_for_mask.rgb = color_for_mask.rgb * color_for_mask.a;

vec4 clip_mask = texture(tex_mask, SCREEN_UV) * channel;
vec4 clip_mask = texture(tex_mask, lookup_mask_uv(SCREEN_UV)) * channel;

float mask_val = clip_mask.r + clip_mask.g + clip_mask.b + clip_mask.a;
color_for_mask.rgb = color_for_mask.rgb * (1.0 - mask_val);
COLOR = vec4(color_for_mask.rgb, 0.0);
Expand Down
32 changes: 31 additions & 1 deletion docs-src/modules/ROOT/examples/2d_cubism_mask_mix.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,39 @@ uniform vec4 channel;
uniform sampler2D tex_main : filter_linear_mipmap;
uniform sampler2D tex_mask : filter_linear_mipmap;

uniform bool auto_scale;
uniform vec2 canvas_size;
uniform vec2 mask_size;
uniform float ratio;
uniform vec2 adjust_pos;
uniform float adjust_scale;


void vertex() {
UV.y = 1.0 - UV.y;
}

vec2 lookup_mask_uv(vec2 screen_uv) {

if(auto_scale == false) return screen_uv;

vec2 r_uv = screen_uv - 0.5;
vec2 calc_pos;

calc_pos.x = (canvas_size.x * adjust_scale) - canvas_size.x;
calc_pos.x = calc_pos.x * (adjust_pos.x / canvas_size.x);
calc_pos.x = calc_pos.x / canvas_size.x;

calc_pos.y = (canvas_size.y * adjust_scale) - canvas_size.y;
calc_pos.y = calc_pos.y * (adjust_pos.y / canvas_size.y);
calc_pos.y = calc_pos.y / canvas_size.y;

r_uv = r_uv + calc_pos;
r_uv = r_uv * (1.0 / adjust_scale);

return r_uv + 0.5;
}

void fragment() {
vec4 color_tex = texture(tex_main, UV);
color_tex.rgb = color_tex.rgb * color_multiply.rgb;
Expand All @@ -24,7 +53,8 @@ void fragment() {
vec4 color_for_mask = color_tex * color_base;
color_for_mask.rgb = color_for_mask.rgb * color_for_mask.a;

vec4 clip_mask = texture(tex_mask, SCREEN_UV) * channel;
vec4 clip_mask = texture(tex_mask, lookup_mask_uv(SCREEN_UV)) * channel;

float mask_val = clip_mask.r + clip_mask.g + clip_mask.b + clip_mask.a;
color_for_mask = color_for_mask * mask_val;
COLOR = color_for_mask;
Expand Down
36 changes: 33 additions & 3 deletions docs-src/modules/ROOT/examples/2d_cubism_mask_mix_inv.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,50 @@ uniform vec4 channel;
uniform sampler2D tex_main : filter_linear_mipmap;
uniform sampler2D tex_mask : filter_linear_mipmap;

uniform bool auto_scale;
uniform vec2 canvas_size;
uniform vec2 mask_size;
uniform float ratio;
uniform vec2 adjust_pos;
uniform float adjust_scale;


void vertex() {
UV.y = 1.0 - UV.y;
}

vec2 lookup_mask_uv(vec2 screen_uv) {

if(auto_scale == false) return screen_uv;

vec2 r_uv = screen_uv - 0.5;
vec2 calc_pos;

calc_pos.x = (canvas_size.x * adjust_scale) - canvas_size.x;
calc_pos.x = calc_pos.x * (adjust_pos.x / canvas_size.x);
calc_pos.x = calc_pos.x / canvas_size.x;

calc_pos.y = (canvas_size.y * adjust_scale) - canvas_size.y;
calc_pos.y = calc_pos.y * (adjust_pos.y / canvas_size.y);
calc_pos.y = calc_pos.y / canvas_size.y;

r_uv = r_uv + calc_pos;
r_uv = r_uv * (1.0 / adjust_scale);

return r_uv + 0.5;
}

void fragment() {
vec4 color_tex = texture(tex_main, UV);
color_tex.rgb = color_tex.rgb * color_multiply.rgb;
// premul alpha

// premul alpha
color_tex.rgb = color_tex.rgb + color_screen.rgb - (color_tex.rgb * color_screen.rgb);
vec4 color_for_mask = color_tex * color_base;
color_for_mask.rgb = color_for_mask.rgb * color_for_mask.a;

vec4 clip_mask = texture(tex_mask, SCREEN_UV) * channel;
vec4 clip_mask = texture(tex_mask, lookup_mask_uv(SCREEN_UV)) * channel;

float mask_val = clip_mask.r + clip_mask.g + clip_mask.b + clip_mask.a;
color_for_mask = color_for_mask * (1.0 - mask_val);
COLOR = color_for_mask;
Expand Down
32 changes: 31 additions & 1 deletion docs-src/modules/ROOT/examples/2d_cubism_mask_mul.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,39 @@ uniform vec4 channel;
uniform sampler2D tex_main : filter_linear_mipmap;
uniform sampler2D tex_mask : filter_linear_mipmap;

uniform bool auto_scale;
uniform vec2 canvas_size;
uniform vec2 mask_size;
uniform float ratio;
uniform vec2 adjust_pos;
uniform float adjust_scale;


void vertex() {
UV.y = 1.0 - UV.y;
}

vec2 lookup_mask_uv(vec2 screen_uv) {

if(auto_scale == false) return screen_uv;

vec2 r_uv = screen_uv - 0.5;
vec2 calc_pos;

calc_pos.x = (canvas_size.x * adjust_scale) - canvas_size.x;
calc_pos.x = calc_pos.x * (adjust_pos.x / canvas_size.x);
calc_pos.x = calc_pos.x / canvas_size.x;

calc_pos.y = (canvas_size.y * adjust_scale) - canvas_size.y;
calc_pos.y = calc_pos.y * (adjust_pos.y / canvas_size.y);
calc_pos.y = calc_pos.y / canvas_size.y;

r_uv = r_uv + calc_pos;
r_uv = r_uv * (1.0 / adjust_scale);

return r_uv + 0.5;
}

void fragment() {
vec4 color_tex = texture(tex_main, UV);
color_tex.rgb = color_tex.rgb * color_multiply.rgb;
Expand All @@ -24,7 +53,8 @@ void fragment() {
vec4 color_for_mask = color_tex * color_base;
color_for_mask.rgb = color_for_mask.rgb * color_for_mask.a;

vec4 clip_mask = texture(tex_mask, SCREEN_UV) * channel;
vec4 clip_mask = texture(tex_mask, lookup_mask_uv(SCREEN_UV)) * channel;

float mask_val = clip_mask.r + clip_mask.g + clip_mask.b + clip_mask.a;
color_for_mask = color_for_mask * mask_val;
COLOR = vec4(
Expand Down
36 changes: 33 additions & 3 deletions docs-src/modules/ROOT/examples/2d_cubism_mask_mul_inv.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,50 @@ uniform vec4 channel;
uniform sampler2D tex_main : filter_linear_mipmap;
uniform sampler2D tex_mask : filter_linear_mipmap;

uniform bool auto_scale;
uniform vec2 canvas_size;
uniform vec2 mask_size;
uniform float ratio;
uniform vec2 adjust_pos;
uniform float adjust_scale;


void vertex() {
UV.y = 1.0 - UV.y;
}

vec2 lookup_mask_uv(vec2 screen_uv) {

if(auto_scale == false) return screen_uv;

vec2 r_uv = screen_uv - 0.5;
vec2 calc_pos;

calc_pos.x = (canvas_size.x * adjust_scale) - canvas_size.x;
calc_pos.x = calc_pos.x * (adjust_pos.x / canvas_size.x);
calc_pos.x = calc_pos.x / canvas_size.x;

calc_pos.y = (canvas_size.y * adjust_scale) - canvas_size.y;
calc_pos.y = calc_pos.y * (adjust_pos.y / canvas_size.y);
calc_pos.y = calc_pos.y / canvas_size.y;

r_uv = r_uv + calc_pos;
r_uv = r_uv * (1.0 / adjust_scale);

return r_uv + 0.5;
}

void fragment() {
vec4 color_tex = texture(tex_main, UV);
color_tex.rgb = color_tex.rgb * color_multiply.rgb;
// premul alpha

// premul alpha
color_tex.rgb = color_tex.rgb + color_screen.rgb - (color_tex.rgb * color_screen.rgb);
vec4 color_for_mask = color_tex * color_base;
color_for_mask.rgb = color_for_mask.rgb * color_for_mask.a;

vec4 clip_mask = texture(tex_mask, SCREEN_UV) * channel;
vec4 clip_mask = texture(tex_mask, lookup_mask_uv(SCREEN_UV)) * channel;

float mask_val = clip_mask.r + clip_mask.g + clip_mask.b + clip_mask.a;
color_for_mask = color_for_mask * (1.0 - mask_val);
COLOR = vec4(
Expand Down
11 changes: 7 additions & 4 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Page Not Found :: GDCubism</title>
<meta name="generator" content="Antora 3.1.7">
<meta name="generator" content="Antora 3.1.9">
<link rel="stylesheet" href="/gd_cubism/_/css/site.css">
</head>
<body class="status-404">
Expand Down Expand Up @@ -36,9 +36,12 @@
<div class="nav-panel-explore is-active" data-panel="explore">
<ul class="components">
<li class="component">
<div class="title"><a href="/gd_cubism/gd_cubism/0.6/ja/index.html">GDCubism</a></div>
<div class="title"><a href="/gd_cubism/gd_cubism/0.7/ja/index.html">GDCubism</a></div>
<ul class="versions">
<li class="version is-latest">
<a href="/gd_cubism/gd_cubism/0.7/ja/index.html">0.7</a>
</li>
<li class="version">
<a href="/gd_cubism/gd_cubism/0.6/ja/index.html">0.6</a>
</li>
</ul>
Expand All @@ -51,15 +54,15 @@
<main class="article">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="/gd_cubism/gd_cubism/0.6/ja/index.html" class="home-link"></a>
<a href="/gd_cubism/gd_cubism/0.7/ja/index.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
</nav>
</div>
<div class="content">
<article class="doc">
<h1 class="page">Page Not Found</h1>
<div class="paragraph">
<p>The page you&#8217;re looking for does not exist. It may have been moved. You can return to the <a href="/gd_cubism/0.6/ja/index.html">start page</a>, or follow one of the links in the navigation to the left.</p>
<p>The page you&#8217;re looking for does not exist. It may have been moved. You can return to the <a href="/gd_cubism/0.7/ja/index.html">start page</a>, or follow one of the links in the navigation to the left.</p>
</div>
<div class="paragraph">
<p>If you arrived on this page by clicking on a link, please notify the owner of the site that the link is broken.
Expand Down
Loading

0 comments on commit 0cedae6

Please sign in to comment.