Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Transparency for a specific camera

Author
Message
Lord Einstein
20
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 18th Apr 2010 18:58 Edited at: 18th Apr 2010 19:01
Hello.

As you probably know DBPro doesn't like to render very large ranges as this results in lots of Z-depth fighting.

To get around this problem I am trying to render two different versions of my game universe. The high detailed and nearby world in the normal space and then a much smaller, lower detail render of the universe rendering all of the distant objects. I am using a second camera to view the low detail distant world and using the image generated to texture the backdrop of the first camera. The detailed world will be reloaded when the players reaches the edge to make it seem very large and the second camera continues to move by a specific amount. By positioning the second camera in at the correct position and rotating it to the same angle as the real world camera I can create what appears to be one endless scene stretching for many thousand kilometres.

However due to the nature of my universe, mainly a large galaxy filled with semi transparent nebular, the second render doesn't appear quite right. When the two camera are in the same position it all looks fine and perfect as seen bellow:

[img][/img]

However, when I position the first camera down in the normal space, far bellow the low detail world, the transparency on the galaxy gets all mucked up, as seen bellow:

[img][/img]

However, it appears fine on the underside of the galaxy.

It seems the transparency always faces camera 0, as this camera is far bellow where the transparencies seem to be pointing. I have an idea which might work of how to solve this particular problem but is there a way to get the transparencies to face a different camera, if that is the problem?
Lord Einstein
20
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 18th Apr 2010 19:02
There we go I got the images working.
Dr Tank
17
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 18th Apr 2010 20:01
What kind of transparencies are you using? DBP plains (planes), or a particle thing? How are you currently rotating them?

I think you should try different flags for SET OBJECT TRANSPARENCY. I think for some modes it sorts the transparent objects by distance, then draws whole objects in order. I think in my experience, DBP sometimes draws transparent objects in order of texture number, but that wouldn't explain your problem here.

Are you disabling zwrite for transparent objects?

Lord Einstein
20
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 18th Apr 2010 22:51
I am using .PNG images and transparency mode 3. Non of the others seem to work at all and the ghost object command is not very good either and they are textured plains rotated so they always face the camera.

I disabled the zwrite thing and the nebular works fine. However, I had to do the same thing to the stars, which were originally ghosted, otherwise they hid areas of nebular on the outskirts of their plain (where they are actually transparent). So I disabled their zwrite as well and a similar problem has arisen. When looking at objects above them they appear to be in the for ground as was originally planned and why I had them as ghost objects. However, when looking down at them they appear behind all other nebular, which I suppose is what the zwrite thing is suppose to do. Its a little annoying as the star loses some of its opacity but dam better than the weird transparency on the nebular.

Thanks.
Fantasy Multimedia
16
Years of Service
User Offline
Joined: 20th Apr 2010
Location: Reno, NV
Posted: 21st Apr 2010 01:39
LE - Could you post a code snippet and media? I wouldn't mind taking a quick look at it.

Login to post a reply

Server time is: 2026-07-26 07:36:11
Your offset time is: 2026-07-26 07:36:11