Test on video card

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy
Contact:

Test on video card

Post by marco.c »

Hello,

I was wondering what Ogre would do if I tried to animate a complex mesh without a 3d card. Would it skip the animation completely, or would it try to animate it aniway?
How can I check whether Ogre will do it or not (in order to give the user an error message)?

Thanks.
M
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 7
Contact:

Post by haffax »

Actually vertex blending in software is the default. If the card is not capable of holding all the bones of a model in the vertex shader's constant registers it will switch back to software blending even if a vertex shader has been specified. So complex meshes (complex as in has many bones) have to be software rendered anyway. I guess there is some API function to ask if hardware blending is enabled, but I don't know it from the top of my head.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy
Contact:

Post by marco.c »

Thanks, I'll check it out.

M
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

This depends on wether you specify both a hardware and software skinning technique (like in the demos) on the material applied to the mesh, or only a hardware one. In the first case, the card will fall back to software skinning, in the second case, nothing will be displayed.
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy
Contact:

Post by marco.c »

Yes, I found an example. The SkeletalAnimation sample shows how to check whether HW or SW skinning are enabled.
It must be possible to select which one is preferable.
Browsing through the code, I came across the classes Technique and Pass, which may be useful.
User avatar
SuprChikn
Bugbear
Posts: 863
Joined: Tue Apr 19, 2005 6:10 am
Location: Melbourne, Aus
Contact:

Post by SuprChikn »

Yes. If you look at the material definition for the robot (it's in Example.material, and the material script is called Examples/Robot) you will see there are two techniques defined in there: one for Hardware Skinning, and the other for Software Skinning.
I believe the way it works is it will default to tring to do the first technique listed in the material script, and if it cant do it (cause the hardware doesnt support it) it will use the next technique in the list. So it will iterate through the list until it finds one it can use, or there are no more techniques listed (which I think would result in nothing being rendered).
User avatar
marco.c
Halfling
Posts: 51
Joined: Mon Nov 22, 2004 5:44 pm
Location: Italy
Contact:

Post by marco.c »

Clear. I think the method getBestTechnique() select the best technique some way. Now I also understand the lass Pass :)
Post Reply