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: EnvironmentLight orientation #1799

Open JonasIsensee opened 2 years ago

JonasIsensee commented 2 years ago

I've noticed that the EnvironmentLight is oriented weirdly:

The center of the image-map is visible in the -Z direction as opposed to in the XY plane. (which is what I would expect). This appears in the examples given in the docs.

SimonDanisch commented 2 years ago

Ah yeah, I think I tried to correct the orientation, but couldn't figure it out fast enough... Some help into investigating the right orientation would definitely be appreciated

JonasIsensee commented 2 years ago

Can you point me in the direction where to start trying? Searching for EnvironmentLight in the code base didn't help me much.

JonasIsensee commented 2 years ago

uff, I read this right RPR has a different understanding of what coordinates should mean.

https://github.com/GPUOpen-LibrariesAndSDKs/RadeonProRenderSDK/blob/3ca5043ef78a822fc7095b8a8cff82f145004edc/tutorials/05_basic_scene/main.cpp#L62

In this example, they use [0,1,0] as the default upvector.

So, since the environment light object does not allow you to provide a "different" orientation. A consistent solution would either require RPRMakie

lazarusA commented 2 years ago

@JonasIsensee did you manage to fix the Envlight? I'm having the same issue 😄

JonasIsensee commented 2 years ago

@JonasIsensee did you manage to fix the Envlight? I'm having the same issue smile

Well, as I stated above. Can't fix it if it's not broken. What you need to do, is to rotate all objects and the camera, e.g. here's my camera settings:

cam = cameracontrols(ax.scene)
 φ = π/180*(25)
 r = 1.5
cam.eyeposition[] = Vec3f(r*sin(φ), 1.2, r*cos(φ), )
cam.lookat[] = Vec3f(0, 0.2, 0)
cam.upvector[] = Vec3f(0, 1.0, 0.0)

Note that this partially breaks opengl mouse interaction but otherwise it's fine. (you're making the camera look at one of the (φ,ϑ) singularities)

ffreyer commented 3 weeks ago

@SimonDanisch Can this be closed or do we consider this a bug?

SimonDanisch commented 3 weeks ago

Yeah I guess its a bug! @JonasIsensee, shouldn't we just change the orientation of the Envlight, instead of changing everything else?

JonasIsensee commented 3 weeks ago

I may remember it wrong, but I seem to recall that the env light orientation is hard-coded. That's why I suggested to rotate everything else. I'd gladly be wrong though.

SimonDanisch commented 3 weeks ago

Can't we transform the image?