upbge icon indicating copy to clipboard operation
upbge copied to clipboard

Access lights from 2Dfilter and shaders

Open Jesusemora opened this issue 6 years ago • 2 comments

now that we have attachments, all that's left is to be able to access the lights and light data from 2Dfilter. This would allow us to create shaders like godrays, lens flare or even AO or shadows.

It would also be posible to render shadeless geometry into the bgl_RenderedTexture and use the attachments to create a deferred 2Dfilter, or a deferred shader for the viewport. we could have both forward and deferred and change it by pressing a button like in unity, or let the user make it from scratch (i don't know if this would be as efficient as having a deferred pipeline).

Jesusemora avatar Aug 06 '18 20:08 Jesusemora

We can expose a uniform block of the scenes lights. I have a brief list without sources in front of me concerning the attributes per light:

  • view space position
  • view space direction
  • color
  • energy
  • type
  • falloff type
  • falloff distance
  • falloff radius
  • falloff cuttoff
  • layer
  • spot size
  • spot blend

Then an other array for shadows:

  • light index
  • texture
  • shadow matrix
  • type
  • filter type
  • bias
  • slope bias

panzergame avatar Aug 23 '18 18:08 panzergame

Exposing this in nodes would bee good to. Like a node that additively samples multiple lights.

adriansnetlis avatar Aug 24 '18 14:08 adriansnetlis