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.

Newcomers AppGameKit Corner / Whats the vertex color attribute called?

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th May 2019 03:18
Hoping someone knows so I don't have to take the hard route and research how to pull it from the memblock data.
Its not agk_MeshDiffuse is it?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th May 2019 05:02 Edited at: 27th May 2019 05:03
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 27th May 2019 13:19 Edited at: 27th May 2019 14:02
Sorry, I meant what's the attribute called when its sent to the shader

edit: Its just called "color" lol
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th May 2019 00:06 Edited at: 28th May 2019 00:07
Looks like agk_MeshDiffuse (combines with vec4 agk_MeshEmmisive) Although it says that is from SetObjectColor() so i'm not sure if it's som internal color value. Only on way to find out
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 28th May 2019 09:49 Edited at: 28th May 2019 09:50
Golelorn has got it correct above that if per Vertex colour is stored in the 3d object that it is passed to the vertex shader as:

attribute mediump vec4 color; <-- Per vertex colour information stored in the model


Most objects dont have per vertex colour unless you specifically try to create and save it in your 3d editor.


vec4 agk_MeshDiffuse = The color of the mesh being drawn, set with SetObjectColor
vec4 agk_MeshEmmisive = The emissive color of the mesh being drawn, set with SetObjectColorEmissive

In addition to these SetAmbientColor() sets the minimum amount of light an object receives.

Login to post a reply

Server time is: 2024-11-21 12:55:19
Your offset time is: 2024-11-21 12:55:19