MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.38k stars 302 forks source link

RPRMakie KeyError: key :absorption not found #1860

Open lazarusA opened 2 years ago

lazarusA commented 2 years ago

The following outputs the error, key :absorption not found

using LinearAlgebra, Random, GLMakie
using RPRMakie, RadeonProRender, Colors

x = y = z = -1:0.2:1
vol1 = [ix * iy * iz for ix in x, iy in y, iz in z]
cmap = :Hiroshige
img = [colorant"grey90" for i in 1:1, j in 1:1]
lights = [EnvironmentLight(1.0, img'), PointLight(Vec3f(2,0,2.0), RGBf(8.0, 6.0, 5.0))]

fig = Figure(; resolution=(1000, 1000))
ax = LScene(fig[1, 1]; show_axis=false, scenekw=(lights=lights,))
screen=RPRMakie.RPRScreen(size(ax.scene); plugin=RPR.Northstar, iterations=4500)
volume!(ax, x, y, z, vol2; colormap = cmap)

GLMakie.activate!()
display(fig)
context, task = RPRMakie.replace_scene_rpr!(ax.scene, screen)
asinghvi17 commented 2 years ago

https://github.com/JuliaPlots/Makie.jl/blob/2eadeed850cff03b5a1d4e1f3cfaef0b8dcb4260/RPRMakie/src/volume.jl#L10

is probably where the error occurs. Something like this) would probably work (specifying algorithm=:absorption, absorption=4f0).

It looks like the other algorithms may not be implemented yet.

lazarusA commented 2 years ago

you were right, of course. No errors now, but I need to figure out the right material and/or parameters because as of now I don't see much, just a faint light and the rest is just transparent.