Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Light to vertex color

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 2nd Dec 2015 09:10
Hi

I would like to know if there is a way to "precalculate" the light directly on the vertex color or on a texture, for each object ?

When I use a directionnal light, the light must be calculated just one time (at the start of the level), not at each frame.
So I would like to precalculate this lighting for each object, save this ighting (vertex color or texture) and simply reload it for the next time I open the same level. So I could win some fps.
I'm looking for the same things for shadow baking.

Any idea on how to do that ?
Thanks a lot.
http://www.dracaena-studio.com
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 2nd Dec 2015 11:52 Edited at: 2nd Dec 2015 11:52
Quote: "I would like to know if there is a way to "precalculate" the light directly on the vertex color or on a texture, for each object ?"


If you rotate a object the light will also rotate when using vertex color , if this is a static objects , then you can do it , in blender you can use "Vertex Painting" to set the vertex colors (just paint the light).
( last time i checked it, the vertex colors was not sent to the shaders , 2014b. But perhaps 2015 is setting the vertex colors. ).

The only problem with vertex is , depending on your models , sometimes the vertex area is large sometimes its small, so using it for dynamic shadows is a problem, see screenshot, bot makes to large shadows and sometimes to small ( this is vertex based, but shadow is white for testing ), again it should only be used for static objects. The default light in agk is vertex based , so you can see how accurate you can get it using the vertex color.
best regards Preben Eriksen,

Attachments

Login to view attachments
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 2nd Dec 2015 13:48
In fact, I have a lot of instance/clone object. So I can't do it in blender ^^.

It's only for static object, which doesn't move/rotaion or scale.
But, I think the better technic should be to precalculate the shadow/lighting on an image, like you have done in your fps demo .
But I don't know how to do that ^^.
http://www.dracaena-studio.com

Login to post a reply

Server time is: 2024-11-17 00:34:52
Your offset time is: 2024-11-17 00:34:52