Shader based Skin

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Shader based Skin

Post by Mel »

Finally, the current trunk of the Irrlicht has support for Multi Render Target. They are great news indeed, so, my question/request for the next development steps for the engine would be that it also included support to use skin shaders, or even, that the skin system of irrlicht used the hardware to make all the operations.

Currently it is the weakest point of irrlicht, and it could enhance totally not only the eficiency of the engine, but also, the looks of the animated skin based models it can display. I think it should be must. Even if the target hardware didn't have support for hardware skinned meshes, it could still fallback to the current software based skin system.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

This has been on the backburner for a while if you wanna take a look at what I got done a few years ago here it is:

http://irrlichtirc.g0dsoft.com/BlindSide/HWSkin.zip

PS: There is a memory leak in the provided source code, you should change it so that it deletes the float arrays in the loop.

Personally I will integrate shadow maps first, this may come after.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

@BlindSide:

I tried it, but it doesn`t give some spottable performance boost- 390 with, 406 without. What calculations are passed to the GPU and what are left for Irrlicht? In what circumstances it has its benefits? Or should I put more models in it?

Woah. A memory leak of 2mb/second. How exactly can I delete those float arrays, since I tried it, but it either doesn`t affect the leak, or causes a crash? :lol:

PS: What are the differences between this and to sio2`s HW skinning demo for Dx9? You know I`m not a "shader guy". Except the released source of course. :D
Thanks. :wink:
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

It should give about 2X performance with more models like 20 dwarves but you have to set EHM_STATIC hardware mapping hint on the models otherwise it won't help that much (Doesn't look like I did that in that sample).

Here is a cleaned up version with the memory leaks fixed but I didn't test it: http://pastebin.com/m45dfa28f

The difference from sio2's is that sio2 copied that demo from a D3D example and also it's only available in D3D9, other than that I can't tell you much because the source was never released.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

Thanks for the memory leak bug. :wink:

When I set the EHM_STATIC hw mapping hint there still has no difference- 390 with, 406 without. Here`s the last version for 1.6 with status text showing the fps and having the hw mapping set.: http://pastebin.com/d3a3a3746
I want to use this in my app, since it`s really easy to use and compact, but I cannot see some results. What am I doing wrong? Or my video card (Radeon 9550) doesn`t support this somehow? :?
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

Great work BlindSide!, though i think is more important to integrate the Hardware Skin support, because the shadows are a secondary matter in graphics representation, on the other hand, the extra time saved by processing the skin calculations using hardware support could be used for other tasks, e.g. just as you said, perhaps, for shadow mapping calculations of animated meshes.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

Mel, does your app run a little bit faster with this skinning? Because it`s not working for me for some reason, probably doing sth wrong... :?

PS: In my opinion hw skinning is more important than shadow mapping too.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, it's not. Because we don't have a proper shadowing at all for now, but we have skinning already. Even if it's slow.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

shadowslair wrote:Mel, does your app run a little bit faster with this skinning? Because it`s not working for me for some reason, probably doing sth wrong... :?

PS: In my opinion hw skinning is more important than shadow mapping too.
It's most likely because of the video card, same results in OpenGL and D3D?

Shadow mapping is a little more straightforward to integrate whilst hardware skinning requires us to intrude on all the original material types and replace their vertex shader with a hardware skinning one whilst keeping all the fixed function functionality, so it's a little more complex. I also found that it's near-impossible to use my method on AMD cards in OpenGL but I haven't tested it on newer ones, only SM 2.0 capable cards.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply