3d object infront of GUITexture doesnt work

I have 2 cameras, I’m using depth of 1 on Main Camera and 0 on the background camera. The background camera has a GUITexture attached to it. I’m also using clear flags of depth only. I dont have the pro version. Please tell me where I might be going wrong.

Hello!

Have you tried playing with the depth of the texture?.

One way I’m sure this can work is to render the object to a texture and put the new texture in front of the texture you want to cover :slight_smile:

rendering textures is a pro feature, I have indy. Obviously I can add a plane behind my model and add a material shader to it, but it doesn’t look as crisp as the GUITexture. Also I’m pretty sure its better for optimization, though I cant prove it.

We can’t render 2D textures with the indie version? Or do you mean render-to-texture? I ask because I know I’ve seen a GUI Texture on-screen. The problem I’ve had is that it’s in front of my 3D scene.

Anyone? Can we not render 2D Textures with the indie version?

I’m not quite sure what you mean by “2D textures”…GUITextures? Sure you can; the comparison page on Unity’s site tells you everything you can and can’t do with Indie vs. Pro, so if it’s not on the list, it’s doable in Indie.

As for 3D objects in front of textures, you need to use two cameras, and GUITextures. Not OnGUI, which is always on top no matter what.

–Eric

I was just refering to the original post. I had read the comparison and that’s why I was asking the question. Thanks for clarifying it.

I was curious about the camera thing as well. I’m suprised you can’t set the depth of a sprite though like you do in XNA. That lets you have just one camera but many layers of sprites.

You can have many layers of sprites, so to speak. One way is to create 2poly meshes (your sprites), and set them at different z-coordinates.

GUITexture is not a sprite.
GUITexture is an explicit GUI element (actually the remainder of Unity 1.x gui system).

If you want sprites you need to implement a system for them or use something like the SpriteManager class found in this board category :slight_smile: