Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
JadingTsunami

Cheap OpenGL sky rendering

Recommended Posts

I'm dealing with limited hardware with only a stripped-down OpenGL implementation to work with. The cheap sky rendering technique I'm using is to use yaw to calculate the sky X-offset and then draw a flat tiled sky background. The world geometry gets put on top of that, and any gaps get "sky" poking through. This is pretty close, but has one big drawback - Boom's sky transfers don't work.

 

I've tried a few approaches, but they're either too expensive (e.g., just tile skies on top of one another -- too expensive due to pixel overdrawing, and depth testing gets weird when I try to layer level geometry on top), or require unsupported features (like TEXTURE_GEN_* for auto-generated texture coordinates) that would be expensive to emulate.

 

I wonder if anyone has tricks or ideas for a cheap sky rendering, or if I just live with the limitation of no Boom-style sky transfers. I looked at PrBoom and GZDoom techniques, but they seem to require unsupported features and emulating those might be costly in terms of CPU.

 

Thanks for reading.

Share this post


Link to post

Without overdraw there is no really cheap method.

But first we need to know what your hardware's capabilities are. Is it limited by pixel fill rate, by vertex througput or by draw calls? Does it support vertex buffers? Stencils?

 

The best tricks here depend a lot on what you can and cannot do. For example, on hardware with good vertex throughput and a buffer implementation but weak pixel fill rate you have to consider totally different options than on hardware with decent pixel fill rate but limited options to use pregenerated geometry.

However, if you got none of this, better strike multiple skies from your list of bullet points.

 

Generally it will be hard to do multiple skies in the same scene without a stencil buffer, because that's the only viable method to isolate the skies' areas sufficiently.

 

Share this post


Link to post

Thanks, I appreciate the insights. Vertex throughput is decent, but there is only limited stenciling. Fill rate isn't great.

 

I found a pseudo-method that swaps the sky texture based on the first visible sector's assigned sky texture. Of course this is buggy, as you can't view 2 different sky types at the same time.

 

I'll see if I can find a way to use what stenciling capabilities exist to come up with something workable.

Share this post


Link to post
35 minutes ago, JadingTsunami said:

Thanks, I appreciate the insights. Vertex throughput is decent, but there is only limited stenciling. Fill rate isn't great.

 

I found a pseudo-method that swaps the sky texture based on the first visible sector's assigned sky texture. Of course this is buggy, as you can't view 2 different sky types at the same time.

 

I'll see if I can find a way to use what stenciling capabilities exist to come up with something workable.

I think Graf more means to ask:

  • What OpenGL version is supported
  • What the hardware consists of. Is it a video card? An FPGA running OpenGL in software?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×