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.

Dark GDK / dbTerrain render order

Author
Message
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 28th Jul 2011 03:17
Is there a way to make the terrain render first? I have some semi-transparent objects that don't look right when they are over the terrain. The only way I think I can do this is to render the terrain by itself (rendering to a image) and place that on the background. This idea will slow down the game, so I would like to do it a different way.
Any ideas?

The fastest code is the code never written.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 28th Jul 2011 03:35
I'd suggest moving over to BlitzTerrain, as you control when it renders.

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 28th Jul 2011 03:40
I am neck-deep in my current project. Changing something that integral would be a nightmare. For all of you that like Blitz, I promise I will look into it for my next project.

The fastest code is the code never written.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 28th Jul 2011 03:41
Ah, fair enough. Other than that, I'm afraid I have no other suggestions. Sorry.

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Jul 2011 07:56
Have you tried using another transparency flag in dbSetObjectTransparency? That's the only idea I have.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 28th Jul 2011 15:28
Yes. Let me explain my situation better. I have a plane for water that is always rendered and is at the same depth (y-value). I also have things like trees that have transparen parts (between the leaves). Most of the terrain is over the water line, so where there is solid ground, I could have a tree. This tree should show the terrain below it where the leaves have their transparency. Instead, I see the water. This means that the terrain is rendered last. I just wanted a way to tell DB to render the terrain first. This would solve the problem.

I have thought of a slightly more complicated (and possibly more costly) way of accomplishing my goal: First, I turn off the backdrop (which I'm doing anyway). Hide/Exclude ALL the objects except the terrain, render, and show/excludeoff ALL the objects and Hide/Exclude the terrain and render again. This would leave the terrain as like the "backdrop" so that the next render would have that show up in the transparent areas..... I would like to avoid this if possible, but it's a shot.

The fastest code is the code never written.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 28th Jul 2011 19:36
Have you tried to set the Texture ID for the terrain = 1 ?
Texture IDs are related to render order, lowest texture IDs are rendered first.
If this fits your scenary, right now the texture ID for the trees is lower than the texture ID of the terrain. Does this match?

Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 28th Jul 2011 22:33
I'll try that. I didn't think it was the same as my normal objects. Even so, I have my trees set to 5000-6000 range and the terrain is 9000 range. I'll let you know how that works out when I get home and try it out.

The fastest code is the code never written.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 28th Jul 2011 23:25
Reordering the IDs did not work. I guess I'll try the double render method......

The fastest code is the code never written.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 29th Jul 2011 02:14
That was dumb.... I figured it out. It had to do with the render order, but it's because of my transparency value. I changed it to dbSetObjectTransparency (WaterPlane,5); and it works like a champ! I keep forgetting that the DGDK documentation is not as complete as the DBP docs. I wish there was an updated version....

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-11-19 08:42:53
Your offset time is: 2024-11-19 08:42:53