Creating New Vertexformat?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
playerdark
Posts: 64
Joined: Mon Aug 01, 2005 5:06 am

Creating New Vertexformat?

Post by playerdark »

Hello,

I apologize if this has been answered before but I could not find anything regarding this.

My problem is that I need a new vertex format in order to forward a more sophisticated bone setup to my vertex shader. I tried the regular GPU programming service functionality which is all well and good, but when it comes to defining a vertex format that goes beyond the 3 that come with Irrlicht, I could not find anything.

Right now it seems to me I have to implement my own video driver, derived from the D3D9 driver ( I dont care about OpenGL so that is fine with me) BUT here's the forst problem since the CD3D9Driver is not officially public. The CPP and H files are in the source directory and are not included by a third party application. That means, I can not just derive a driver from C3D9Driver and overwrite the functions I need to overwrite, but copy the complete code into my application and also provide access to includes like the NULL driver, which is also not the way it is supposed to be.

On top of it, it seems to me that I have to alter the original engine in order to add a new vertex type within the engine, the struct as well as the enum type.

So that's what I have concluded is necessary to work with a new vertex type.

Is there any way to do this that I have overlooked and that is cleaner and uses the OO features of Irrlicht better?

Thanks for any advice
r-type
Posts: 41
Joined: Sun Feb 12, 2006 1:54 am

Post by r-type »

Hi, yes you'll have to alter the engine. Because it looks at the vertex type and decides how to feed it into dx. Ofcourse you must not forget that youll have to create a class that convert the regular types to the type you want.

But perhaps all of this is not necessary ? please explain why you want to do this
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The architecture is not meant to provide access to the implementations of the classes. If you want to stay with an unaltered Irrlicht library you have to copy the code. But it's of course possible to add the new driver to the core library and thus access the implementations directly. But I guess that for implementing a new video driver it is ok to include it into the library instead of adding it on top.
playerdark
Posts: 64
Joined: Mon Aug 01, 2005 5:06 am

Post by playerdark »

Well what I need it for is a skeletal animation system. I have implemented it based loosely on Cal3D in software now, but I want to use hardware skinning. I need 2 or possibly 4 positions together with the blend weights and the matrix indices per vertex, so none of the existing formats accomodates me there
Post Reply