venerdì 17 luglio 2015

Day 33: Flatness

It's been a while since i was able to render a nice, flat color.

That's because now each model was forced to interact with light, and so it was impossible to make it 100% bright.

So i "invented" a new variable called Flatness, which is passed as alpha in the color (since alpha is not used for anything else because deferred shading doesn't support transparency).

This variable could vary between 0 and 1, where 0 is the original color and 1 is the color after light interaction. It is now possible to lerp between the two values.

I don't know if thats the classic way to do it, i just improvised, but it seems a reasonable way to do it.

In the image i rendered 50 light. the spheres are 100% flat, the walls are 100% non-flat.
The fps are around 12 at 800x600, and around 4 at 1920x1080, but we are talking about 50 dynamic ligths, each one of them so close to the camera that it is rendered at fullscreen. So i guess that the performace is quite good (with ~5 lights i can get 60 fps at fullscreen)

Enjoy the screenshot, today it's quite nice :)


Nessun commento:

Posta un commento