Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toon_outline_width of 0 should result in no outline #8

Open
WilliamTylerBradley opened this issue Jun 9, 2022 · 0 comments
Open

toon_outline_width of 0 should result in no outline #8

WilliamTylerBradley opened this issue Jun 9, 2022 · 0 comments

Comments

@WilliamTylerBradley
Copy link

When using the material_list function with type = "toon", I think having toon_outline_width = 0 should result in no outline. Instead, it makes all the objects red. I didn't see another option to remove the outline, but I might have missed it.

remotes::install_github("tylermorganwall/rayvertex")
#> Skipping install of 'rayvertex' from a github remote, the SHA1 (f1c3289f) has not changed since last install.
#>   Use `force = TRUE` to force installation
library(rayvertex)

# Example works like the documentation
set.seed(1)
col = hsv(runif(1))
scene = sphere_mesh(position=runif(3),
                    material=material_list(diffuse=col, type="toon",toon_levels = 3, 
                                           toon_outline_width = 0.025,
                                           ambient=col,ambient_intensity=0.2),radius=0.1)

for(i in 1:30) {
  col = hsv(runif(1))
  scene = add_shape(scene, sphere_mesh(position=runif(3),
                                       material=material_list(diffuse=col, type="toon",toon_levels = 3,
                                                              toon_outline_width = 0.025,
                                                              ambient=col, ambient_intensity=0.2),
                                       radius=0.1))
}

rasterize_scene(scene,
                light_info=directional_light(direction=c(0.5,0.8,1)),
                background = "white",fov=10)
#> Setting `lookat` to: c(0.53, 0.49, 0.50)

# set toon_outline_width = 0
# I'd expect this to be the previous image with no black outlines on the spheres
# but it makes all of them red instead?
set.seed(1)
col = hsv(runif(1))
scene = sphere_mesh(position=runif(3),
                    material=material_list(diffuse=col, type="toon",toon_levels = 3, 
                                           toon_outline_width = 0,
                                           ambient=col,ambient_intensity=0.2),radius=0.1)

for(i in 1:30) {
  col = hsv(runif(1))
  scene = add_shape(scene, sphere_mesh(position=runif(3),
                                       material=material_list(diffuse=col, type="toon",toon_levels = 3,
                                                              toon_outline_width = 0,
                                                              ambient=col, ambient_intensity=0.2),
                                       radius=0.1))
}

rasterize_scene(scene,
                light_info=directional_light(direction=c(0.5,0.8,1)),
                background = "white",fov=10)
#> Setting `lookat` to: c(0.53, 0.49, 0.50)

# set toon_outline_width = -0.025
# This gets the desired result, but feels hacky
set.seed(1)
col = hsv(runif(1))
scene = sphere_mesh(position=runif(3),
                    material=material_list(diffuse=col, type="toon",toon_levels = 3, 
                                           toon_outline_width = -0.025,
                                           ambient=col,ambient_intensity=0.2),radius=0.1)

for(i in 1:30) {
  col = hsv(runif(1))
  scene = add_shape(scene, sphere_mesh(position=runif(3),
                                       material=material_list(diffuse=col, type="toon",toon_levels = 3,
                                                              toon_outline_width = -0.025,
                                                              ambient=col, ambient_intensity=0.2),
                                       radius=0.1))
}

rasterize_scene(scene,
                light_info=directional_light(direction=c(0.5,0.8,1)),
                background = "white",fov=10)
#> Setting `lookat` to: c(0.53, 0.49, 0.50)

Sys.info()
#>                                                                                                 sysname 
#>                                                                                                "Darwin" 
#>                                                                                                 release 
#>                                                                                                "21.5.0" 
#>                                                                                                 version 
#> "Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101" 
#>                                                                                                nodename 
#>                                                                                            "Tylers-MBP" 
#>                                                                                                 machine 
#>                                                                                                "x86_64" 
#>                                                                                                   login 
#>                                                                                                  "root" 
#>                                                                                                    user 
#>                                                                                          "tylerbradley" 
#>                                                                                          effective_user 
#>                                                                                          "tylerbradley"

Created on 2022-06-08 by the reprex package (v2.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant