Project idea:Instancing & crowds.
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
*Hem*
just another question.
I've made shaders in glsl, but...I cannot use vs 2.0 or greater with an ATI card right? Only with an nVidia card, using modes vp30.
So in fact my shaders are useless, because:
-the cg shader compiled in arbvp1 will do the same thing for the instancing shader
-using only vs 1.1 has is a non-sense for crowd rendering using shader instancing, because with 20 bones the limit of 96 float4 is reached with one object.
In addition, the object count per batch for shader instancing of static objects will be reduced to 32(maximum) in gl mode.
So, I put the glsl shaders or I just add new vertex program declaration of the same code with different shader version configuration?
just another question.
I've made shaders in glsl, but...I cannot use vs 2.0 or greater with an ATI card right? Only with an nVidia card, using modes vp30.
So in fact my shaders are useless, because:
-the cg shader compiled in arbvp1 will do the same thing for the instancing shader
-using only vs 1.1 has is a non-sense for crowd rendering using shader instancing, because with 20 bones the limit of 96 float4 is reached with one object.
In addition, the object count per batch for shader instancing of static objects will be reduced to 32(maximum) in gl mode.
So, I put the glsl shaders or I just add new vertex program declaration of the same code with different shader version configuration?
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
Yeah I know that ATI cards have SM 3, but the vertex program version, there is nothing after vs 1_1 for opengl and ATI cards, if I refer to the manual:
http://www.ogre3d.org/docs/manual/manual_18.html#SEC85
http://www.ogre3d.org/docs/manual/manual_18.html#SEC85
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
Hi everybody. I give some news, even if it is quite late , because of my recent job(programming the wii is fun ), and also exams, because even if I've a job in the game industry, I've chosen to continue the student life in parallel
About the instancing, I've uploaded the last samples and code here( http://crashy.cartman.free.fr/SOC/ogrenew.rar ), but the glsl shaders that I made were not working at all. I get some error when accessing to the matrix array using the object's index. I'm sure that some of you will create glsl shaders better than I.
For the crowds using instancing in glsl, I saw this topic :
http://www.ogre3d.org/phpBB2/viewtopic. ... lsl+weight
But the patch made the paginglandscape plugin crash, and I had urgent job to do with it for Antharia.
In fact I'm disappointed by myself, not to have succeded to get the openGl mode working with the shader instancing code.
But I don't plan to give up the baby, as I have some ideas to improve the "transparency", doing the use of instanced object look like the one of standard objects(IE, A way to make object picking).
And some others little things to add cool features to OGRE.
NB: As soon as my cvs client will work, I'll submit a patch(if necessary ).
Still thank you for the SOC organization, and sorry for the little failure
About the instancing, I've uploaded the last samples and code here( http://crashy.cartman.free.fr/SOC/ogrenew.rar ), but the glsl shaders that I made were not working at all. I get some error when accessing to the matrix array using the object's index. I'm sure that some of you will create glsl shaders better than I.
For the crowds using instancing in glsl, I saw this topic :
http://www.ogre3d.org/phpBB2/viewtopic. ... lsl+weight
But the patch made the paginglandscape plugin crash, and I had urgent job to do with it for Antharia.
In fact I'm disappointed by myself, not to have succeded to get the openGl mode working with the shader instancing code.
But I don't plan to give up the baby, as I have some ideas to improve the "transparency", doing the use of instanced object look like the one of standard objects(IE, A way to make object picking).
And some others little things to add cool features to OGRE.
NB: As soon as my cvs client will work, I'll submit a patch(if necessary ).
Still thank you for the SOC organization, and sorry for the little failure
- Zeal
- Ogre Magi
- Posts: 1260
- Joined: Mon Aug 07, 2006 6:16 am
- Location: Colorado Springs, CO USA
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
Hello, just merged with the last Eihort sources, same link:
http://crashy.cartman.free.fr/SOC/ogrenew.rar
Still trying to generate a diff file, wincvs don't find the ogreSceneManager.h/cpp files, and tortoiseCVS only writes the beginning of the diff file
http://crashy.cartman.free.fr/SOC/ogrenew.rar
Still trying to generate a diff file, wincvs don't find the ogreSceneManager.h/cpp files, and tortoiseCVS only writes the beginning of the diff file
- Kencho
- OGRE Retired Moderator
- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
Hi there, I'm upping the topic because I think there is a bug in the instandinc code for the skinned objects, but I cannot find what's wrong.
It's related to this topic:
http://www.ogre3d.org/phpBB2/viewtopic.php?t=34601
The vertex declaration of the object is :
Position (float3)
Normal (float3)
Blend Indices (U4)
BlendWeights (Float)
Diffuse Color (Float4)
Texture Coord(float2)
and the object index (float1)
The position and the normal are in the first buffer, the diffuse color, tex coords, and object index are in the second buffer, and the blend indices and blend weights are in the third buffer.
The vertices are skinned to only one bone each, so weights are 1 everytime .
The object skinning is totaly wrong (only the vertices linked to the first bone are correctly skinned) when using the crowd shader adapted to 1 weight per vertex:
I really don't see what's wrong, because after some hours debugging the vertex data copy, everything seems good.
I think I'll find a solution but before spending all my full time on this problem, I wonder if someone has an idea.
Thanks
It's related to this topic:
http://www.ogre3d.org/phpBB2/viewtopic.php?t=34601
The vertex declaration of the object is :
Position (float3)
Normal (float3)
Blend Indices (U4)
BlendWeights (Float)
Diffuse Color (Float4)
Texture Coord(float2)
and the object index (float1)
The position and the normal are in the first buffer, the diffuse color, tex coords, and object index are in the second buffer, and the blend indices and blend weights are in the third buffer.
The vertices are skinned to only one bone each, so weights are 1 everytime .
The object skinning is totaly wrong (only the vertices linked to the first bone are correctly skinned) when using the crowd shader adapted to 1 weight per vertex:
Code: Select all
blendPos += float4(mul(worldMatrix3x4Array[index*numBones+blendIdx], position).xyz, 1.0) ;
I think I'll find a solution but before spending all my full time on this problem, I wonder if someone has an idea.
Thanks
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
Hi again. After massive debug I think that I've foudn the problem.
Buffer copy is right, the shader is good, the bone matrices are good.
But I made a comparaison between a batch of 1 object using instanced geometry, and the same object with hardware skinning.
I checked bone per bone, forcing the blend indice in the vertex program, to see how transformations were different.
And when debugging I saw that when using the character as a single entity, the blendIndexToBoneIndexMap list had only 15 bones, and the model has 18 bones.
If I understant the meaning of this list, it contains only the bones that are linked to a vertex <=> if none of the vertices of the mesh is assigned to a bone, this bone is not in the list. Is it really that?
If so, I understant where was the bug, as the blend indices must be changed.
Buffer copy is right, the shader is good, the bone matrices are good.
But I made a comparaison between a batch of 1 object using instanced geometry, and the same object with hardware skinning.
I checked bone per bone, forcing the blend indice in the vertex program, to see how transformations were different.
And when debugging I saw that when using the character as a single entity, the blendIndexToBoneIndexMap list had only 15 bones, and the model has 18 bones.
If I understant the meaning of this list, it contains only the bones that are linked to a vertex <=> if none of the vertices of the mesh is assigned to a bone, this bone is not in the list. Is it really that?
If so, I understant where was the bug, as the blend indices must be changed.
-
- Gnoblar
- Posts: 12
- Joined: Tue Jun 07, 2005 11:54 am