Imagination PowerVR SDK Blog

Vertex Splitting and tangente space

pvrshaman

#1

Hi,



i am having problems to run the deferred shading application using my custom model.

i provided a model with a texture and a bump image (use for normal calculation per pixel i assume ) as well



the application generate gl error at :

glVertexAttribPointer(TANGENT_ARRAY, Mesh.sTangents.n, GL_FLOAT, GL_FALSE, Mesh.sTangents.nStride, Mesh.sTangents.pData);

glEnableVertexAttribArray(aUniforms[j].nLocation);


vertext array not in correct size.

i am using the 3ds max plugin to export my model and generate the pod with tangent and binormal activated.

from the doc i can figure the vertex spliting but i dont know what value should go in there.

as well you have different type for the tangent and bi normal , is assume it s float but what will be the criteria to select other types related to the geometry of the model ?



thanks alot for your future answer,



kind regards

david



#2

all good i ve got it working

thanks

david


#3

Thank s alot to provide an example of this wonderfull Technic


#4

Hi David,



Glad to hear you’ve got it working :slight_smile:



What was the problem?



Thanks,

Joe


#5

i have an error at the line described because setting of the model.

1/ the bump image need to be affected in my 3ds max as pvr because it will be not possible to set it , unless you do it in the code during the loadtexture

as an improvement i wish to see in the PVRSHAMAN shoud show at lease in the material hierarchy the :

diffuse attribs

specular attribs

bump attribs


2/ the format of the normal and the setting of the bitangent does matter :slight_smile: that was my doubt, now it ’ s clear.i missed the float in the normal ,unsigned float it was.



now my sample base on your code is beautifull ,looking like i always dream about it :slight_smile:

this sample is well coded , i mean in term of usage of PFX , it s really good,

i cant live without PFX and POD, it s crazy how it become simple to have a nice layered architecture and control the effect on your model easyyyyyyyyy…driven by gameplay…



kind regards

david