Application prototype #14
@ -121,7 +121,7 @@ vec2 sphere_cast(vecInv v, vec3 dir) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
const int sphere_cnt = 2;
|
const int sphere_cnt = 3;
|
||||||
|
|
||||||
vec2 scr = (2.*gl_FragCoord.xy - resolution) / shortdim;
|
vec2 scr = (2.*gl_FragCoord.xy - resolution) / shortdim;
|
||||||
vec3 dir = vec3(focal_slope * scr, -1.);
|
vec3 dir = vec3(focal_slope * scr, -1.);
|
||||||
@ -130,9 +130,11 @@ void main() {
|
|||||||
vecInv sphere_list [sphere_cnt];
|
vecInv sphere_list [sphere_cnt];
|
||||||
sphere_list[0] = sphere(vec3(0.5, 0.5, -5. + ctrl.x), radius.x);
|
sphere_list[0] = sphere(vec3(0.5, 0.5, -5. + ctrl.x), radius.x);
|
||||||
sphere_list[1] = sphere(vec3(-0.5, -0.5, -5. + ctrl.y), radius.y);
|
sphere_list[1] = sphere(vec3(-0.5, -0.5, -5. + ctrl.y), radius.y);
|
||||||
|
sphere_list[2] = sphere(vec3(-0.5, 0.5, -5.), 0.75);
|
||||||
vec3 color_list [sphere_cnt];
|
vec3 color_list [sphere_cnt];
|
||||||
color_list[0] = vec3(1., 0.214, 0.);
|
color_list[0] = vec3(1., 0.25, 0.);
|
||||||
color_list[1] = vec3(0., 0.214, 1.);
|
color_list[1] = vec3(0., 0.25, 1.);
|
||||||
|
color_list[2] = vec3(0.25, 0., 1.0);
|
||||||
|
|
||||||
// cast rays through the spheres
|
// cast rays through the spheres
|
||||||
vec2 depth_pairs [sphere_cnt];
|
vec2 depth_pairs [sphere_cnt];
|
||||||
|
@ -211,7 +211,7 @@ fn main() {
|
|||||||
)
|
)
|
||||||
input(
|
input(
|
||||||
type="range",
|
type="range",
|
||||||
max=3.0,
|
max=5.0,
|
||||||
step=1.0,
|
step=1.0,
|
||||||
bind:valueAsNumber=layer_threshold
|
bind:valueAsNumber=layer_threshold
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user