- Home /
Problem with lens-like black squares preventing skybox to be entirely shown
Hi,
I am an artist and I am almost done creating a very simple piece with Unity and Bridge engine. It is my first Unity project, yet everything worked fine so far, except for one problem I cannot solve: I am showing an image made of a text written white on black into a completely, say, red Skybox, but instead of having red everywhere except on the image, there is a big lens-like square around the image and the red skybox is only on the margins of the field of view. I attach a screen capture. Please don’t mind the “point back at the mapped area” announcement (I am working with Bridge), that is not the problem. The problem is that I would like the whole skybox to be red except the image of the text written white on black that you can see in the background, but some setting I don’t know keeps these black lens-like squares at pushes the skybox to the margins only. There is no lighting in the piece. I couldn't find any troubleshooting of this sort on Unity documentation, therefore I am writing to you today in order to know if you can help me with this issue. Many thanks!
I'm not sure how you managed to get the red in the border on the VR image, but this area is not a rendering of the world, rather it is 'run off space' for the VR distortion. So that seems odd.
What happens if you run the project in a 'non-VR' form, do you see the red skybox you made?
Answer by TSI25 · Jan 09, 2018 at 03:24 PM
I had a similar problem a while back so I'm gonna take a stab at whats wrong.
The problem is your red skybox isnt being rendered by your main camera. It is probably on an ignored layer and being rendered from a separate camera entirely. From the looks of it you have at least a 2 or 3 camera solution going on here. I would GUESS you have a Main Camera that is looking at your scene but isn't picking up your red skybox, a camera rendering the skybox and perhaps other things, and a third camera you might not have known about. You can check the number of cameras in the scene at run time by searching for 't:camera' in the scene hierarchy to see if this guess is accurate.
That first Main Camera is actually rendering out to a render texture and not directly out to the player, that render texture is then distorted and broken out into those two lens views, and that render texture is then recorded by that third camera that some VR solutions seem to use. The camera rendering the red skybox doesn't render to that render texture and therefore doesn't make it into the lens view but rather seems to render into the empty spaces around the lenses.
The solution if this is accurate is to avoid using a separate camera for rendering out the skybox, or to make sure that the second camera is dumping out to the same render texture that the main camera is. That render texture is PROBABLY being generated at runtime so you'll have to write a script that grabs the render texture from the main camera and assigns it to any other camera's you want to render out the player.
I recommend the first solution because having additional cameras in the scene can get very intensive, especially in vr. always try to minimize the number of cameras you have rendering stuff!
If this guess is wrong it would be very helpful to know what platform you are targetting so we have a better idea of what VR solution is at play here.
Answer by remy_rm · Jan 09, 2018 at 03:26 PM
From what i can tell there are 2 possible solutions to your problem; one being (and i think this is what you want) setting the "clear flags" variable on the "Camera" object containing both "eye" cameras to "skybox" instead of the "solid color" it seems to be set too.
Another possible solution could be to set the background colour of the camera to the desired colour.
Hope this helps!
~Remy.
Answer by aw_adf · Jan 12, 2018 at 08:34 AM
Hi, thanks for both your answers. I already tried to change the "clear flags" mode and to play with "solid color" and "Skybox" functions, but it doesn't change anything, unfortunately. I had a look if I had multiple cameras in the project following your suggestion, TS125, but I don't, there is actually only one camera. I am working on this project by modifying a VR template of Bridge Engine by Occipital for Unity, because it is a VR installation with motion tracking via occipital sensor (Structure Sensor mounted on Bridge Viewer plus iPhone 7), so it could be that the problem is in Bridge. For instance I noticed that if I don't erase all mesh colliders in the model my image becomes more transparent and the problem seems to disappear, but I don't want any pink mesh collider to appear while moving around, the whole space should be of just one color. I don't know if you are familiar with Bridge Engine and you can help me with that, I also asked them of course but no substantial answer so far. In any case, many thanks again!
Does the problem occur if you build it up from scratch in a fresh empty project, without the Bridge Engine?
I didn't try but I guess it wouldn't, I think that the problem is connected to the motion tracking engine. I am a complete beginner and I can't write script, that's why I used the template and the already existing interface. If the problem is not solved in this thread, I'll try to work with an experienced user. If you have other ideas though, please don't hesitate to tell me! Thanks!
I think realistically you're going to have delve into code to try and resolve this issue. There could be so many things going wrong here that I'm pretty sure it'll need to be looked into by a C# programmer.
You could either enlist the help of an experienced programmer, or if the Bridge Engine is designed to be used by artists, you could contact the support $$anonymous$$m for that software and see if they can help.
It doesn't at first glance seem to be a problem with Unity itself (although I'm prepared to be proven wrong on that of course!).
Your answer
Follow this Question
Related Questions
Procedural Skybox Color 0 Answers
Change Color of Skybox 0 Answers
Skybox color pls help! 0 Answers