Very, very much want to add deferred rendering, global illumination

It’s worth to study your work deeper! :slight_smile:

Do you know this example with lots of light sources made without shader? demo

2 Likes

Yes! I never got that far into shader code thanks to @Heaust-ops. I think it really needed this “oh-really-you-can-do-that??” moment.

1 Like

This technique reminds me the old days on Commodore Amiga where you could use maximum of 32 colors from a palette so we divided the screen and we changed the palette for example in the middle of the screen so we ended up with 32 colors for the upper portion of the screen and 32 for the lower but you couldn’t mix both color palettes together.

3 Likes

I did not realize you were on Amiga dude!!

Fond memories :smiley:

2 Likes

Check this out master:

2 Likes

Ok now we talk :smiley:

1 Like

guys, can you help me take a look at this pg? I don’t understand why the tunnel wall has a different effect on the lighting when the camera is facing in different directions. The difference is that when the camera looks in the z direction, the tunnel wall renders the lighting effect normally, but when I look in the -z direction, the lighting effect of the tunnel wall disappears. I guess there may have been some changes in the normals texture of gBuffer @Deltakosh

1 Like

It is because by default normals are in view space but you can confiure the gbuffer renderer for it:

geometryBufferRenderer.generateNormalsInWorldSpace = true;
6 Likes

Thank you very much. I really appreciate your enthusiasm and expertise.

1 Like

I couldn’t follow this thread, but I would like to give an opinion considering forward+ instead of deferred rendering if possible. Forward vs Deferred vs Forward+ Rendering with DirectX 11 | 3D Game Engine Programming (3dgep.com)

My hopes are down since forward+ requires -not very supported- compute shading afaik

1 Like

Seems you listened carefuly because the result is amazing! :muscle:

1 Like

I hope this will find its way to one of Babylon’s future releases :eyes:

2 Likes

reposting the PG where I last left

also here’s the npm package

3 Likes

Hey wait, there is new stuff :astonished: Cool, I missed that earlier. Thanks real @Heaust-ops


Fingers crossed :smiley:

2 Likes

yeah, I’d suggest not use the npm package until it hits v1 tho

I’m having some trouble trynna get it to work, it works fine locally and when I build/publish it smth goes wrong

: /

I’m mid fixin that : )

Fixed. also did some treeshakin stuf and now the lib is down to ~4kb gzipped (~12kb unpacked)

I’ll do some more testing on this, if it works out well, we’ll reach v1 : D

3 Likes

Looking good!

Can the lighting pass be enabled without a camera? I am thinking about adding the deffered lighting inside a post-process rendering pipeline which would then be assigned to a camera at the pipeline level :thinking:

1 Like

sadly, need the camera position for calculating lighting on pbr mats : /

bUT, you can always get the pp by DeferredPointLight.postprocess and detach it from the camera after assigning : O

you do need to update the DeferredPointLight.attachedCamera to the camera that’s using the pp or lighting will look off for pbr mats : /

edit: unlesss postprocess holds a reference to whatever camera it’s rendering from when it gets applied, I’ll look into this : O

Yes you can get the camera used by the postprocess with

this.onActivateObservable.add((camera) => {
      DeferredPointLight.attachedCamera = camera; // store the active camera in your class
});

And then use the camera you get there to update the camera position. I think that could work

1 Like

awesome : ) postprocess itself has a getCamera that I think is the right cam as well,

I’ll remove cam dependency next update : D