- Home /
"Scroll" or "offset" the cubemap ...
Here's one ..
Imagine a shiny car with a cubemap sky. You see the "clouds" on the car.
The car and the camera are simply static.
Now, I want the clouds to move over the surface.
How the heck would you do that? You really can't "offset" a cubemap. Is there a way?
Essentially, I want to scroll the top image of the cubemap (or perhaps all four of them on the tunnel sides). In this way, it would look like the clouds (say) are moving along.
Somewhat related issue:
grab the car and tumble it on it's x axis (or indeed, just move the camera around)
The way a cubemap is rendered on an object depends on the bearing of the camera to the object.
I guess there's essentially a quat that gives that relationship.
So with the camera and object static.......... how can I manually 'scroll" that relationship??
(TBC, this would make it look as is if the distant world was "tumbling around" the car - even though the car was sitting still.) {Could be very useful for eg. space effects etc.}
To be concrete, in both these questions, say we're using everyday Reflective/Bumped Diffuse
Again, what I really wanna do is part A .. in a word, scroll some clouds (or whatever) over the surface.
(I have to believe this is a fairly common need ??)
Cheers!!! PS pls don't mention renderToCubemap in this :-)
caption contest ...
"where the hell are the offset fields?"
Answer by Bunny83 · Oct 27, 2012 at 10:55 PM
I don't think that's possible since you can't scroll a cube map even when it consits only of tilable textures because 3 textures meets in one corner. reflection mapping is ment for "static" reflections.
If you want to "fake" this effect it's probably easier to write a simple shader that maps another cloud texture onto your car ;). Could be done as detail map or in screen space. See image 5 and 6. It might a bit tricky to make it look like a reflection.
btw, by the camera and the car are "static", do you mean they stay in position but can rotate or are really static?
"I don't think that's possible since you can't scroll a cube map even when it consits only of tilable textures because 3 textures meets in one corner" for sure, as a krative matter and you want to avoid seams you'd have to go to vagueness on the two ends I guess. But I just wanna know if you can scroll the sides (one or all) of a cubemap ......
I guess it's no huh?
Or my question B, how to "manually" spin a cubemap?
(Note that if your cube map was just clouds everywhere - no traditional black ground - just spinning it would suggest cloud movement. TBC in that case viewing the bottom of the vehicle would not be sensible.)
I guess your 2e paragraph is the answer to the effect - thanks!
Indeed, does Unity give us a detail shader in the standard set ... ? You rock
For that matter .. I wonder .. do you happen to know, what's the current state of affairs with a reflection shader in Unity?
(Other than using renderToCubemap, or a flat mirror.)
If you want buildings reflected in your ferrari, basically is that now possible in U? Cheers!! :)
So you mean "real" reflections? Well, i don't know any way of doing this at shader level. The usual approach for simple reflections (for a flat surface) is to render the scene twice but mirrored and clipped at the mirror surface plane. For more complex relfections the only way i could think of is to rerender a cube map for each object when it moves.
AFAI$$anonymous$$ this is no limitation only in Unity, it's simply too complex for realtime rendering. At the time we have realtime raytracing it might be possible ;) Euclideon claims that they can do something like that, but their project doesn't look very sophisticated. At least they didn't come up with a real demo. All they have are some youtube videos showing their engine.
Until we see a real prove, the vids are just nice to watch.
Gotchya. Cheers
Euclideon - fascinating thanks! Damn Aussies eh. I did not know about them. I would guess in the far future we will move beyond the polygon paradigm but I guess Euclideon is probably not it for now.
{ What's with all the crap about cactii and stuff?? If you'd just invented some "God mathematics" that let you do full point-wise descriptions of detailed reality, on current tiny computers ... you wouldn't be gabbing about how you drew a cactus! :-) Goodness. }
I'm, sure you have a copy of Akenine /Haines / Hoffman, the chapter near the end The Future has a nice general discussion of our Future involving perhaps ray tracing, micropolygons, etc.
I think there is an opportunity for "pseudo real" "moving reflections" - in other words, to suggest a vehicle moving forwards
much as cubemap perfectly solves having a general "rather real looking, pseudo real" chrome vibe swish over your car as it yaws
So you could have something that lets you scroll basically a cubemap-ish image over the surface. So you could have a "general" representation (trees say on the side, clouds overhead, black underneath) and you could use it to represent the world swishing along.
(TBC, it would only work reasonably in a specific setup - just as a cubemap only works in a "reasonably matching" situation.)
Really, it's surprising someone hasn't come up with a "general cloud reflections rushing over you" shader .. you can imagine being able to just set the speed they are rushing over the vehicle.
I guess I should shut up and try to apply a detail texture, just as you say.
An interesting question is "Do the latest car games, aircraft games, etc on PS3 have such reflections" i.e. do you see tree reflections sweeping over the car as you rush under some trees. I tried to check out some video of gran turismo in play but it's all just reviewers talking :)
Cheers !