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 / [bug] 2.0.18 SetObjectCullMode(,0) and shader light.

Author
Message
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 18th Mar 2016 10:57
When using SetObjectCullMode(,0) and backfaces is displayed, the shader do not invert the normals , so light do not work ( or is inverted ).

I know i could use double sided planes but i need as few polygons as possible.

its for a realtime generation of billboards. if you look at the screenshot you can see that the billboard version of the object has inverted light ( when backface is facing camera ).
if you look at the realtime generated billboard you see that the textures i generate for the billboard objects has a merged texture from different angles of the same object baked into one texture. So the billboard must have the same rotation as the original object to reflect it correctly. ( i cant just let it face the camera ).



best regards Preben Eriksen,

Attachments

Login to view attachments
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 21st Mar 2016 14:34
Unfortunately this is complicated by the fact that most of the lighting is done in the vertex shader, and the vertex shader can't know whether it is part of a forward facing or backward facing polygon. For example, looking at a sphere, a vertex on the very edge could be part of both forward and backward facing polygons. So the only solution in this case would be to have multiple polygons.

Login to post a reply

Server time is: 2024-11-25 08:22:51
Your offset time is: 2024-11-25 08:22:51