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

RPRMakie errors in render_rpr #4695

Open
2 of 3 tasks
rafaqz opened this issue Dec 31, 2024 · 4 comments
Open
2 of 3 tasks

RPRMakie errors in render_rpr #4695

rafaqz opened this issue Dec 31, 2024 · 4 comments
Labels
bug good first issue This should come with some instructions! RPRMakie This relates to RPRMakie, the raytracing backend for Makie based on AMD's RadeonProRender framework.

Comments

@rafaqz
Copy link
Contributor

rafaqz commented Dec 31, 2024

  • what version of Makie are you running? (]st -m Makie) 0.21.18
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
  • What platform + GPU are you on? windows intel iris

The lookat field accessed here doesn't seem to exist:

l, u, p, fov = c.lookat[], c.upvector[], c.eyeposition[], c.fov[]

This is using the RPR example in the Tyler docs

ERROR: type PixelCamera has no field lookat
Stacktrace:
  [1] getproperty
    @ .\Base.jl:49 [inlined]
  [2] update_rpr_camera!(oldvals::@NamedTuple{}, camera::RadeonProRender.Camera{…}, cam_controls::Makie.PixelCamera, cam::Camera)
    @ RPRMakie C:\Users\rafael.schouten\.julia\packages\RPRMakie\g1jlP\src\scene.jl:6
  [3] display(screen::RPRMakie.Screen, scene::Scene; display_kw::@Kwargs{})
    @ RPRMakie C:\Users\rafael.schouten\.julia\packages\RPRMakie\g1jlP\src\scene.jl:341
  [4] display
    @ C:\Users\rafael.schouten\.julia\packages\RPRMakie\g1jlP\src\scene.jl:333 [inlined]
  [5] colorbuffer(screen::RPRMakie.Screen)
    @ RPRMakie C:\Users\rafael.schouten\.julia\packages\RPRMakie\g1jlP\src\scene.jl:323
  [6] backend_show(screen::RPRMakie.Screen, io::IOStream, ::MIME{Symbol("image/png")}, scene::Scene)
    @ Makie C:\Users\rafael.schouten\.julia\packages\Makie\Y3ABD\src\display.jl:485
  [7] (::Makie.var"#1366#1367"{Module, Bool, @Kwargs{…}, Scene, MIME{…}, Scene})(io::IOStream)
    @ Makie C:\Users\rafael.schouten\.julia\packages\Makie\Y3ABD\src\display.jl:353
  [8] open(::Makie.var"#1366#1367"{…}, ::String, ::Vararg{…}; kwargs::@Kwargs{})
    @ Base .\io.jl:410
  [9] open
    @ .\io.jl:407 [inlined]
 [10] save(file::File{…}, fig::Scene; size::Tuple{…}, resolution::Nothing, backend::Module, update::Bool, screen_config::@Kwargs{…})
    @ Makie C:\Users\rafael.schouten\.julia\packages\Makie\Y3ABD\src\display.jl:344
 [11] save(filename::String, fig::Scene; args::@Kwargs{…})
    @ Makie C:\Users\rafael.schouten\.julia\packages\Makie\Y3ABD\src\display.jl:304
 [12] save
    @ C:\Users\rafael.schouten\.julia\packages\Makie\Y3ABD\src\display.jl:301 [inlined]
 [13] render_rpr(m::Tyler.Map{LScene}, name::String, radiance::Int64)
    @ Main c:\Users\rafael.schouten\.julia\dev\Tyler\docs\src\map-3d.md:81
 [14] top-level scope
    @ c:\Users\rafael.schouten\.julia\dev\Tyler\docs\src\map-3d.md:113
Some type information was truncated. Use `show(err)` to see complete types.
@rafaqz rafaqz added the bug label Dec 31, 2024
@jkrumbiegel
Copy link
Member

jkrumbiegel commented Dec 31, 2024

That field only exists on a 3D camera, and your scene has a PixelCamera. As this scene comes from inside a Tyler created object I assume something changed there in the meantime.

@rafaqz
Copy link
Contributor Author

rafaqz commented Dec 31, 2024

Ahh so this is a Tyler bug. @SimonDanisch

@ffreyer
Copy link
Collaborator

ffreyer commented Dec 31, 2024

The Camera object (i.e. scene.camera, always exists) also effectively holds a copy of those fields

Makie.jl/src/types.jl

Lines 292 to 303 in d6fdf25

"""
Direction in which the camera looks.
"""
view_direction::Observable{Vec3f}
"""
Eye position of the camera, used for e.g. ray tracing.
"""
eyeposition::Observable{Vec3f}
"""
Up direction of the current camera (e.g. Vec3f(0, 1, 0) for 2d)
"""
upvector::Observable{Vec3f}

Iirc I added view_direction for lighting in GLMakie at some point, and Simon needed upvector for FastPixel scatter in 3D. We should just use thisin RPRMakie too. We also talked about swapping view_direction = lookat - eyeposition for lookat to directly mirror Camera3D, but didn't get to it yet.

@ffreyer ffreyer added RPRMakie This relates to RPRMakie, the raytracing backend for Makie based on AMD's RadeonProRender framework. good first issue This should come with some instructions! labels Jan 18, 2025
@ffreyer
Copy link
Collaborator

ffreyer commented Jan 18, 2025

This should just require a switch from scene.camera_controls to scene.camera in RPRMakie and maybe an update of the camera in Tyler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue This should come with some instructions! RPRMakie This relates to RPRMakie, the raytracing backend for Makie based on AMD's RadeonProRender framework.
Projects
None yet
Development

No branches or pull requests

3 participants