Does anyone know how to convert a cubemap texture to a sphere map in a shader?
I think sphere map textures are commonly used as a lookup for environmental lighting.
Does anyone know how to convert a cubemap texture to a sphere map in a shader?
I think sphere map textures are commonly used as a lookup for environmental lighting.
Check CubeToPano (EX9.Texture)
This might be handy if you want to make maps to use in other programs. If you are wanting to do lookups in vvvv cubemap is the way to go though, as that’s what all the hlsl functions use.
Also if you meant more like a light probe or matcap type image then you can just render a sphere with the reflections on it.
Hi everyoneishappy
Thanks for the link. cube to pano could be handy, but I’m looking for a way to take a cubemap (generated realtime in vvvv) and turn it into a spheremap texture as a way to apply post processing, before turning back into a cubemap for reprojection, all in realtime
Hi everyoneishappy
Thanks for the link. cube to pano could be handy, but I’m looking for a way to take a cubemap (generated realtime in vvvv) and turn it into a spheremap texture as a way to apply post processing, before turning back into a cubemap for reprojection, all in realtime
In that case have a look at PanoToCube (EX9.Texture) help patch. It’s a demo of exactly that. Keep in mind with some effects you might end up with seams though.
I want to go between a cubemap and this - http://www.bzfusion.net/skymaps/ANGMAP11.JPG
hey
check Preview (EX9.Texture), “Cubemap Mode” pin, set it to “Ball”
there is a shader inside that module, which does this cubemap projection, should be usable
ahhhhh!
Thank you…
Don’t suppose there is a way to go ball > cubemap as well?
:)
here ya go
SphereMapConvert.zip (12.0 kB)
What service! unc for knighthood \o/
sweeeeeeeeeet. thankyou!
Any idea how, in the CubeToSphere shader, I could adjust the number of degrees field of view visible?
The way to do this as a post process is simply to scale the resulting texture, as the change in view angle is constant in a sphere map, so to have a 180 degree fov, you’d scale the texture by 2.
It would be nice to do this directly in the above shader though.
got it working here, but it’s dx11
CubeMap.zip (363.1 kB)
ooooh nice. I shall have a look. Was going to update these for dx11 anyhow.
How are your dx11 experiments coming along?