[UPDATE] - Fur - Deferred shading

I won’t be creative, nor original at this, but both water shader and volumetric lighting look awesome. Just wanted to let you know you haven’t lost the attention you undoubtedly deserve :slight_smile:.

Thanks man.

I’m trying to get some foliage, looks a bit cheap atm.
Will maybe look better with the old grass and hardware instancing.

Update on the fern foliage :


(no lights or shadows)

96 quads

Update :

(blender render), hence the water having no shader applied.

First, I’m so impressed with your work, but unfortunately the link just broke :cry:.

When you have time, Could you re-update please? -

Thanks for coding for Panda3D.

EdmundosTown, the final panda is coming.

I’m rewriting the deferred shading system, I noticed problems in original code with normal maps when scaling models and the directionnal light code was wrong.

http://youtu.be/vICHdQpi-qg
(I changed the music :smiley:)

I still have problems with lights lagging frames behind when translating or zooming the camera.

I’m experimenting with optimizations now, with 50 points lights I have 40 fps.

I don’t know why someone disliked the video. keep up the good work.

I always feel jealous that I can’t do anything like that, always wish Panda’s shader generator would have more effects like these included.

It was because of the jingle bells music I think, I’m having fun with AudioSwap sorry :smiley:

Update with gizmos from kurohyou.

http://youtu.be/ewPPOM4nAkw

I know it’s a bit of thread necromancy on my side but has anyone any code from things posted here? Was it ever made public?

I’m most interested in the basic deferred shading + normal mapping code from page 1. I’m sure it must be something simple (or ‘simple-ish’ )but I really fail to understand how a models normal map would end up in the normal buffer.

Code in the start post implements normalmapping + deffered shading quite well.
About normal buffer - in that example it created by autoshader. This post How AutoShader calculates the normals? can help if you would implement normal buffer by yourself.

I did the trivial thing - replaced the smiley model with one that has a normal map and tangent/binormals, but I see no trace of it in the buffer viewer

Ah, you should make one of built-in lights. For example - just ambient light. It will force autoshader to render normals respective to the normals texture.

Yes, that did the trick, but I don’t think I would have figured that out myself.

Don’t quite understand. You wish to make the normal buffer with your own shader? If so, just dump an autoshader (dump-generated-shaders) and modify it/look how it works.
Or can you explain what exactly you wish?

I got what I wanted. It just looks strange to me that I need to add a ‘forward’ light to get working deferred lights.
I think I will grab the dumped shader and try to get rid of the extra light at some point… but I see no gain in that - one white ambient light is cheap. But first I’ll try to get gloss and maybe glow textures. I have no idea what to do with transparency and shadows but I’ll think about them when I get there.

I think that it’s just optimisation in the autoshader - if you didn’t have any lights in the scene then normal maps wouldn’t work in any case, and generator can simplify generated shader.

Are you using the latest Panda? I recall that I fixed that bug for 1.8.1. From the release notes:

EDIT: Oh wait. Is the problem that the normal maps aren’t written to the ‘normal’ RT when no lights are attached? That would indeed be a bug. If I don’t get back on this then please file a bug report.

OK, I just checked in a fix, which will be in the next release of Panda (and the next buildbot builds of course).

Cool that it got fixed, but unless there’s a way to tell the autoshader to store glow and gloss in the rendered textures then I still need to edit the shaders - lucky for me it’s a very simple edit and no extra inputs are needed :wink:

There’s one part of the code that I don’t understand. At some point there’s an ‘aux buffer’ created, but I don’t see it used for anything later on, commenting it out gave no visible change - is there any point in keeping it?

I’d like to add unlit, semitransparent particles (flames, lightning, magical explosions and suchlike). I was thinking I could render them to a new buffer (from a new camera with a new mask) and then lerp this with the lit scene. Am I thinking in the right direction, or that’s not how you do it?