I'm attempting to build a gui similar to the front row black environment with subtle reflections, but in 3D. Is there any way to achieve this reflections/environment with unity pro? Thanks.
Yeah, render to texture can do this. You pick a camera to render as a texture. I think it is a matter of drag and drop, not sure I dont have pro, but yes you can do this. Very cool pro feature, you can use it for things like security cameras cameras too. Bill
Do you have a enviroment map (skybox) that you use ? It it is allright that it is static, you do not even need a pro but can just use the reflective shaders we ship. Are you talking about 3d buttons that are placed on the screen, and that can be moved around? it might be a little more dificult to do that... explain a little more of what the scene should look like, and I might be able to help. Reflections from dynamic scenes can be expensive to render though. - Peter
The idea is to have a dark studio setup where a set of 3d buttons appear. These buttons do indeed move (actually roate) and I want to have a reflective ground plane. The idea is to achieve somthing like: http://www.apple.com/imac/frontrow.html
I would recomend mirroring the geometry, and rendering it again with a slightly darker color. If you render under the reflecting plane you want to make blend the mirrored geometry in. If your buttons can move outside the plane, you would need to mask using the stencil or some other method, that might be a little more complicated. Another way could be to render the buttons only into a texture. You should set up the camera to render from under the plane, orthogonal to the view direction. This might only work from specific scenes though, where you are somewhat far away from the reflecting buttons. I think the mirroring is the best choice, especially if the reflecting is only on the plane and the buttons are always over the plane. - Peter
Here is a quick reflection using render to texture. This is the first time I have tried this (and I am not experienced in this graphics stuff),so keep that in mind. I assume someone who knew what they were doing could clean it up, but as a proof of concept I think it shows what you might want to accomplish (movement being mirrored). This is the PPC binary.
Come to think of it, since you have the pro (I think I misunderstood something perhaps) you can just use the water shader with no ripples... That should give you what you want I think.. - Peter
I tried the water reflection, but somehow it simply des not work right. I named the camera as needed, and it actuaally reflects, but the reflected image does not seem to refresh correctly. For example if I make a sphere over a reflective plane it starts correctly, but if I move the sphere, the plane will add the whole trajectory of the reflection, thus looking very odd. ie the reflection for the previous frames is not removed, but added! Am I missing something? Thanks! Alejandro
It seems to work pretty well here... What is the "clear flags" set to on the camera that renderes the reflection? It should be set to solid color I guess, it sounds like it is set to dont clear. That should clear the render texture so it does not accumulate each frame. - Peter
Did you drag in the water prefab? There is a lot more to setup than just attaching the water material to a plane. So i is best to just drag the water prefab in and modify the material from there to not have any ripples.
So far so good. http://www.zerofractal.com/fractalreality/menu-test-camino.html Now I have to make the arrows work fine and think up some good icons. What do you think?
Once I saw the prefab I just fell for it. I will post one with icons soon. I have a question. I want the camera to move slightly, just subtle slow rolls (+- 5 degree) and very slow movements always mantining its point of view. Is there a prefab or easy way to achieve this random slow moves? Thanks.
You could just modify the position in the Update function using one of the Random class functions. http://www.otee.dk/Documentation/ScriptReference/Random.html After you have moved it just use transform.LookAt to make the camera look at some target transform.
I can see the mip-levels switch quite clearly on the water bumpmap... You should consider setting to trilinear and aniso sampling in the texture inspector....
Joachim, I implemented the look at controles an a random local position, but have no idea on hoy to damp the result of the position vector to make it really slow and smooth. Please look at this to have a laugh. Talk about handshake!! http://www.zerofractal.com/FractalReality/060406-menu-test.html This is the main concept but really really slow and smooth. This is my current component Code (csharp): //Smooth Camera shake Component - Zerofractal Studio var Radius = 0.25; function Update () { transform.localPosition = Random.insideUnitSphere * Radius; }
Try smoothing it. (Note i haven't actually tried this) Code (csharp): //Smooth Camera shake Component - Zerofractal Studio var Radius = 0.25; var smooth = 1.0; function Update () { transform.localPosition = Vector3.Lerp(transform.localPosition, Random.insideUnitSphere * Radius, Time.deltaTime * smooth); }
Thanks, but while this smoothes it out, it is equivalent to reducing the radius of the postiton vector, so I need to increase the radius, which again increses the speed and shkyness.. What I have in mind is very slow but continuous translations, so that for example the camera moves slowly in one direction, then in another, etc etc. all in one smooth, chaotic single trajectory.
Noise is art. Fortunately many books have been written on the topic. Been toying around with fractal noise years ago so here comes the overkill solution. The Perlin noise based smooth position script. Put the Noise.cs script in a folder called Plugins or Standard Assets, this way you can access it from javascript. Then put the SmoothRandomPosition.js script anywhere.
Wow. thanks! just a problem. When assigning the js to my gameobject I get the following error: "Can't add script behaviour to SmoothRandomPosition. The script needs to derive from MonoBehaviour". Looking a bit further the problem narrows to unity not being able to loas script class "noise". any clues? I put the class on the root of standard assets with no luck.
worked like a charm. It seemed to be loading the script before the cs, just put the script outside the standard assets and it worked. It should be a nice addition to the camera scripts! http://www.zerofractal.com/fractalreality/060409-menu-test.html Just one side note. It seems that the range prosition in added to the original location, thus making the movement displace drom the original location. I think that by simply subtratting it from the position variable might do the trick. Thanks once again!
Here is a small update: http://www.zerofractal.com/fractalreality/060410-menu-test.html Added images of the levels, and a higher res sky. One thing that bugs me is thta if you look at the box's semas you see a black line. Is there any way to aovid this? I'm cedrtain the skybox's edges are semaless. Now I have to work on the arrow navigation, and on the button click operations. I have anothe question. Is there a way to create the menu items on the fly? I am planning on writing a component in which you say how many buttons you want and the respective textures for each, and voila. Thanks
Make all the textures wrap mode to be clamped instead of repeating. This is setup in the texture inspector.
Worked!! Not really clear it should be like this, but nice to know. One question, is there a place where one could write/read this tips for newbies?
Another Question. Is there any way to change the geometry of the water prefab? I want ot make a rectangular pool, and the prefab is an elliptic ocean. Thanks!
Yes. Just drag a mesh from project view onto the water. (All meshes of an imported asset are shown when you fold out the asset in the project view)
So far so good: http://www.zerofractal.com/fractalreality/060410-prism-menu.html Now I need to add an animation when an item is selected. Menu can be navigated with joystick or keyboard. Press F1 for help.