|
how do i fade in a scene from a black screen to a skybox? later i want to crossfade the first skybox to a second skybox. finally i want to fadeout the second skybox to a white screen. how do i do that? thanks, flexrails
(comments are locked)
|
|
You'd do the fading to white/black placing a single-colored texture across your screen, and changing the alpha value of it over time so that it fades in, or fades out. There are a number of different ways of placing this texture on-screen, you could:
The code you'd use for the 3rd option above might look something like this. You'd start the alphaFadeValue at 1, and the "/ 5" is so the fade lasts 5 seconds.
(comments are locked)
|
|
To fade between two different sets of skybox textures, there's a shader on the Wiki designed to do exactly this, here: http://www.unifycommunity.com/wiki/index.php?title=SkyboxBlended it says that it requires minimum hardware. how would i do 2 skyboxes without that minimum hardware?
Dec 02 '09 at 01:30 PM
flexrails
I think these are pretty low-spec hardware requirements. It says "GeForce 3". According to Wikipedia, the GeForce 3 series were introduced in 2001, and were superceded in 2002 by the GeForce 4 series. If you really needed to achieve this on very old hardware, you would probably need to create your own skybox system, where you draw the skybox twice, once with the first skybox texture, then again with the 2nd texture using an alpha-blended shader. You would probably want to use an additional camera in your scene dedicated to this task, so that it gets drawn behind everything else.
Dec 02 '09 at 01:59 PM
duck ♦♦
(comments are locked)
|
|
I've just been working on the same thing. I've adapted the wiki shader mentioned above so that it can be used on older machines. It's very similar to the original - I just manged to get rid of one 'set texture' so it can be used on all but the oldest machines (the only Unity emulation mode that doesn't support it is 'dinosaur'). Older machines will show the first skybox only.
To animate between one texture and the next:
To fade from the second skybox to the first skybox start with thisMaterial.color.a=1.0; and use -= instead of += To change what you are fading to and from simply change the material variables. Eg, to fade from black to the second skybox texture:
To fade between different skyboxes set the different textures like we did above, but this time with your skybox textures, not a single black texture. For the second set of textures use how sad that none of our newer answers get the attention they deserve... :)
Nov 03 '10 at 10:19 PM
fireDude67
(comments are locked)
|
|
to crossfade between two skyboxes, you could create two skyboxes, one slightly bigger than the other so that it encompasses the other. Then you could fade the inner one's alpha to make it fade in or out.
(comments are locked)
|
|
You can crossfade between 2 materials with the Lerp method: http://docs.unity3d.com/Documentation/ScriptReference/Material.Lerp.html Note that that method will only interpolate float and Color values - it will not interpolate shader rendering or textures. It would, however, be okay to fade from a solid color to a texture.
Sep 19 '12 at 07:01 AM
rhys_vdw
(comments are locked)
|
1 2 next page »
