Page 1 of 2

Re: Some thoughts about light in general

Posted: Sat Jul 20, 2013 10:15 pm
by ssilk
SilverWarior wrote: Many (to many) of them had awsome graphics but crappy gameplay. So I would rather play game with crappy graphics and great gameplay than game with great graphics and crappy gameply becouse the later would always bee crappy game.
... you can be sure that I will rather support and idea which brings new feature to the game than the idea that simply makes game look a bit better.
Too true.
To the developers: forgot about anything I suggested above, it's too early to think about it! :)

Normal maps for cool lighting effects

Posted: Wed May 21, 2014 7:56 am
by Tenebrous
Since the sprites are created in a 3D package, it would be relatively simple to also have normal maps for them.

This would allow some really cool lighting effects (including changing time of day, although of course this messes up shadows!)

I understand that there are issues with the huge atlases at the moment, however, so perhaps this could be an option for people with more memory on their graphics cards.

Normal maps for cool lighting effects

Posted: Wed May 21, 2014 7:57 am
by Tenebrous
Moved to this thread cause of initiator-request. :) -- ssilk
Another thread, also created by Tenebrous, with the same name is merged into this. --ssilk

-----------------------

Since the sprites are created in a 3D package, it would be relatively simple to also have normal maps for them.

This would allow some really cool lighting effects (including changing time of day, although of course this messes up shadows!)

I understand that there are issues with the huge atlases at the moment, however, so perhaps this could be an option for people with more memory on their graphics cards.

Example from a tool called 'Sprite Lamp'

Edit: By 'time of day', I meant changing the lighting direction based on time of day, as obviously the game already has night/day :)

Re: Normal maps for cool lighting effects

Posted: Wed May 21, 2014 8:27 am
by Trucario
Tenebrous wrote:Since the sprites are created in a 3D package, it would be relatively simple to also have normal maps for them.

This would allow some really cool lighting effects (including changing time of day, although of course this messes up shadows!)

I understand that there are issues with the huge atlases at the moment, however, so perhaps this could be an option for people with more memory on their graphics cards.

Example from a tool called 'Sprite Lamp'
Damn, its amazing.

Re: Normal maps for cool lighting effects

Posted: Wed May 21, 2014 8:58 am
by ssilk
Well, that isn't that easy. Technically there are some things standing against it.
- the sprites are rendered with light coming from upper left. If you change the direction it would look strange
- extra shadows need more RAM. It's already a big issue, that the sprites use too much video-ram.
- it would make it more unmovable. The graphics from mods has problems to be rendered.

We'll.I can think one thing: to make it graphically really cool, the game calculates the shadows itself. Every sprite becomes something like a form, some cubes, very simple. For that a transparent shadow is calculated, which is laid above the stuff. It might not be looking perfect, but it would look amazing. But the afford is really high.

Re: Normal maps for cool lighting effects

Posted: Wed May 21, 2014 9:57 am
by Tenebrous
ssilk wrote:- the sprites are rendered with light coming from upper left. If you change the direction it would look strange
No, the point is that you render the sprites with completely flat lighting, and let the normal map control all the lighting from then on.
ssilk wrote:- extra shadows need more RAM. It's already a big issue, that the sprites use too much video-ram.
Aye!
ssilk wrote:- it would make it more unmovable. The graphics from mods has problems to be rendered.
Not sure what you mean... all that would change is that each sprite would have it's graphics plus a separate one for the normal map.
ssilk wrote:We'll.I can think one thing: to make it graphically really cool, the game calculates the shadows itself. Every sprite becomes something like a form, some cubes, very simple. For that a transparent shadow is calculated, which is laid above the stuff. It might not be looking perfect, but it would look amazing. But the afford is really high.
I think that's a bit of overkill really :D The normal-mapped lighting would work even if you didn't have moving shadows - for things like explosions, and other lights on things.

Re: Normal maps for cool lighting effects

Posted: Wed May 21, 2014 9:59 am
by Tenebrous
Not sure why this thread appeared twice, anyway here's my edits to the other one:

Have a look at this example from a tool called 'Sprite Lamp'.

Also, by 'time of day', I meant changing the lighting direction based on time of day, as obviously the game already has night/day :)

Re: Normal maps for cool lighting effects

Posted: Wed May 21, 2014 12:14 pm
by Drury
Actually when I was theorizing a hypothetical game I'd make I had something similar in mind. By something similar I mean nearly identical.

I'm actually surprised this is something new and kickstarter/Steam-worthy, seems to me like a general technique that is somehow never used.

Re: Normal maps for cool lighting effects

Posted: Wed May 21, 2014 2:16 pm
by ssilk
Well, this would be absolutely amazing. :) I would like to see that depth and the atmosphere in the night.

As always :) we've been discussing this earlier:
https://forums.factorio.com/forum/vie ... f=6&t=1089

But your aspect is completely new. The main problem is: For the night, most of the shadow-maps need to be stored in the video-RAM. I think this is just a hard technical limit. There are other thoughts: The map is a big hurdle to modders. If they do not add the shadow layer, the thing looks just odd.

An implementation to my point of view could look so, that every object has a sprite, but also a very simple 3D model. This avoids of having the additional bitmaps for the shadows, they are created from the model, the model can stay in normal memory.

But even then it is a big technical hurdle. I don't see much chances for that.

Re: Normal maps for cool lighting effects

Posted: Wed May 21, 2014 3:32 pm
by ssilk
Tenebrous wrote:
ssilk wrote:- it would make it more unmovable. The graphics from mods has problems to be rendered.
Not sure what you mean... all that would change is that each sprite would have it's graphics plus a separate one for the normal map.
Replace unmoveable with unMODable. iPad is sometimes nasty...

Re: Normal maps for cool lighting effects

Posted: Wed May 21, 2014 3:33 pm
by Tenebrous
ssilk wrote:
Tenebrous wrote:
ssilk wrote:- it would make it more unmovable. The graphics from mods has problems to be rendered.
Not sure what you mean... all that would change is that each sprite would have it's graphics plus a separate one for the normal map.
Replace unmoveable with unMODable. iPad is sometimes nasty...
I don't think it affects that at all. Except now, instead of just having image file for an object, you have two. One with the colours as now, and one with the normal map.

Re: Some thoughts about light in general

Posted: Wed May 21, 2014 3:50 pm
by ssilk
Well, my favourite music programm Reason by Propellerheads does do such things.

Reason Developers can add new devices/instruments (they call it Rack Extensions, RE) to Reason and sell it through their shop. The idea is, that the RE-developers create the idea and Propellerheads looks, that it works, no matter which platform, graphics, soundcard etc. This includes also the visible part of the device, the knobs, buttons, switches, and so on. A developer needs to define all the knobs etc. as a 3D map and they render from that some 2D images. The results are compelling (for example: https://shop.propellerheads.se/product/e670-equalizer/ - this graphics is rendered for the shop only)

I know, this is somehow complicated, but I think this direction only leads into something, which can be used in some future.

And it would make the work much more easier!! :)

How?

I think about so: Currently Albert delivers the pure graphics to the factorio-devs. I mean, they found some way speed things up in this process, but it is still many work by hand.

What if Albert delivers only the 3D-modells and the rest is made in a build-process?

And once there is such a build-process, and it is working reliable, why not using other models from other mod-developers or other artists and put them also in this queue? The advantage would be, that they would have the same look, resolution and so on.

And (!) they can calculate the shadows from different angels, because they have the 3D-model. And from that point on, you can do much more really, really cool stuff, like the link above....

Well, just some thoughts...

Re: Some thoughts about light in general

Posted: Thu May 22, 2014 8:42 am
by cube
ssilk wrote:What if Albert delivers only the 3D-modells and the rest is made in a build-process?

And once there is such a build-process, and it is working reliable, why not using other models from other mod-developers or other artists and put them also in this queue? The advantage would be, that they would have the same look, resolution and so on.
To me this sounds like a great idea, but AFAIK Albert does quite a lot of manual post processing on the 2D sprites before including them in the game, so I'm afraid that he wouldn't approve.

Technically this should be pretty simple -- just a python script that controls a blender instance for rendering...

Re: Some thoughts about light in general

Posted: Thu May 22, 2014 11:14 am
by ssilk
Last year my team has been in a similar situation: the designers developed great graphics, cool CSS styles and so on, but we couldn't integrate that automatically. Every style needed to be integrated by hand, and if it changed, the work begins from start. That costs us very much time to integrate the graphics. So we wrote a tool, where the designers had the possibility to integrate the CSS/graphics and test, if it fits all. So they did the work. The designers loved it, they said that makes the work with us much easier, cause they now can just try things out and immediately se, what fits and what not. And we loved it, cause we don't need to integrate all the time. The result was a big speed up in the development-process and much faster and reliable deploy.

If you continuously improve this process, every version the biggest work, the stupidest job, you will see some performance gain in about 2-3 month.

Re: Some thoughts about light in general

Posted: Thu May 22, 2014 12:15 pm
by Tenebrous
cube wrote:...AFAIK Albert does quite a lot of manual post processing on the 2D sprites before including them in the game...
Well, to be honest that'd be something to automate soonish, especially as Albert's time is already full up :D

Re: Some thoughts about light in general

Posted: Thu May 22, 2014 2:09 pm
by krux02
First of all. Light is the most complicated and complex thing you can simulate. You can invest hundreds of hours into this topic. I am a developer myself and I know how much work it is. At the moment light is pretty simple. There is one lightmap where all light sources are added and then at night, the lightmap is multiplied with the image. This is easy too implement and not too wrong.

at the moment shadows are just constant, so every model has it's own shadow image. The only way to make this realistically would be to project the shadows from 3d models to the ground which is just not feasible if you consider that in the game are no 3d models left anymore. It would also drastically increase rendering complexity. So I don't see that happen soon. Also for realistic lighting we would need correct normal maps for each model in the game and I don't see that happen soon.

Short answer you just need more man power to get it correct. On the other hand colorful light's would be pretty easy.