OpenGL 4 wish list

Started by
9 comments, last by taby 1 year, 4 months ago

In the little renderer that I made with your help, I have implemented quite a few features now. For instance:

  • Depth of field (sort of)
  • Glossy reflections
  • Shadow maps
  • Glow map, thanks to warp9
  • Tracers, thanks to joej

What else should I try to implement, other than SSAO?

Advertisement

You have nothing for indirect lighting, so if you can't design around that, this would be more essential than most of your features.

Assuming static lighting is fine, the options are:
Diffuse: Lightmaps, and/or diffuse probes (which you need additionally for dynamic objects, or you use it for static env. too)
Specular: Reflection probes (cube maps at lower spatial frequency than diffuse probes, or manually placed), or nothing

After that, you could also support PBS materials if you want.

But to make a decision, you need to know how your world will look like first. So you know if a warped 2D grid of probes is fine (height map alike scenes), or if you need 3D grids (eventually sparse) for complex interior scenes.
Te generate probe data, you either need to find a way to use DCC tools (e.g. rendering cubemaps with blender, or lightmaps (or voxel colors in your case) with Magica Voxels), or you make your own path tracer.

So that's serious work. The alternative would be a non realistic artstyle and using just one global probe. Then you need to tone down importance of lighting, making the use of darker beside brighter areas harder.

In case you do not really know yet how your game will be, i'd ignore gfx for now and figure this out first.

I'm stuck on the idea that individual spells and whatnot should be accompanied by a dynamic, shadow-casting light source.

Like, in Metroid for the Switch, where each shot is accompanied by a light source.

And your advice is sound. I will be working on the design for the next while, before I code it all out. Thanks again!

taby said:

I'm stuck on the idea that individual spells and whatnot should be accompanied by a dynamic, shadow-casting light source.

Like, in Metroid for the Switch, where each shot is accompanied by a light source.

That part definitely sounds cool to me!

taby said:
I'm stuck on the idea that individual spells and whatnot should be accompanied by a dynamic, shadow-casting light source.

Try it, but try keep your expectations on shadowed light counts at some sane level. ; )

Artistic argument: Point lights cause ugly, unnatural hard shadows. If it's many sources which also move, this causes distracting patterns on the image.
Technical argument: Very expensive. Not only for the SM rendering and shading, but there is also extra cost on finding occluder geometry nearby each light. (You don't want to render the whole scene for each light in general. Though for all lights of one spell using the same set of occluders would be fine, as they are close to each other.).

Deferred, unshadowed lights would ofc. cause none of those problems.

Btw, this also is a case where ray traced shadows can actually beat SMs, because they need just one global acceleration structure vs. many SMs.

Hmm.. Try as I might to get PCF shadow maps working, I cannot succeed. But you're right, there is no penumbra without PCF.

big time hard shadows

Well, as it stands, there are 3 maps – glow, specular, and colour. I have 32 image units on my GPU, so that leaves me with 32 - 3 = 29 lights. But yes, that probably would be SLOOOOOOOOOOW. One thing I notice about shots in Metroid, is that they travel super fast, and you only get like 3-4 shots off before they start exiting the screen. Also, I don't know if those shot lights cast shadows or not.

taby said:
32 - 3 = 29 lights

For particles causing shadows, you'd need SM cube maps, so 29/6?
Screams for SM atlas, putting all SMs into a single texture. Or array texture, which counts as a single one too?

taby said:
Also, I don't know if those shot lights cast shadows or not.

Then i guess they don't. Nobody would make these shadowed for mobile class HW. Even FPS muzzle flash on PC is mostly unshadowed.
It's hard enough to get shadows from static lights, where they are actually noticeable. But for special effects it's mostly only emissive material on particles for glow, plus eventually a lower count of unshadowed light sources, or just one at the averaged center from all particles. The light source could be a larger spherical light with a short range falloff, to hide it's only a single light.

To make a visual impression, it's more effective and cheaper to have nice sparkling / color / trails effects for the particles.

Thank you for the elaboration, sir.

As far as I can reckon, the cubemap only takes up one image unit. It is of type samplerCube instead of sampler2D. I could be wrong, but I’m pretty sure.

https://github.com/sjhalayka/obj_ogl4/blob/4de0a9602634a0c698772d8c400c8e9f41901577/point.fs.glsl#L23

This topic is closed to new replies.

Advertisement