raymarch from cube edge, not from the camera
This commit is contained in:
parent
2459a3a059
commit
42d3a39fe1
1 changed files with 2 additions and 2 deletions
|
|
@ -89,7 +89,7 @@ fn fragment(
|
|||
) -> FragmentOutput {
|
||||
var in = vertex_output;
|
||||
|
||||
let ray_origin = view.world_position;
|
||||
let ray_origin = in.world_position.xyz;
|
||||
let ray_direction = normalize(in.world_position.xyz - view.world_position);
|
||||
|
||||
let local_origin = (volu_material.model_inverse * vec4<f32>(ray_origin, 1.0)).xyz;
|
||||
|
|
@ -100,7 +100,7 @@ fn fragment(
|
|||
var out: FragmentOutput;
|
||||
|
||||
if t > 0.0 {
|
||||
let local_hit_point = ray_origin + t * ray_direction;
|
||||
let local_hit_point = local_origin + t * local_direction;
|
||||
let local_normal = mandelbulb_normal(local_hit_point);
|
||||
|
||||
let world_hit_point = (transpose(volu_material.model_inverse) * vec4<f32>(local_hit_point, 1.0)).xyz;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue