Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Model texture not visible and animation speed decreasing gradually - help

Author
Message
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 27th Jul 2012 00:56
Hello,

Character animation of a loaded .x file begins to slow down as I load multiple times the same file - around 50 times. How can I keep
the animation speed constant. The frame rate is stable at 21.

Here is the code loop: -

for (int i =0;i<50;i++)
{
ObjectCharacters[i]=dbLoadObject("media/wispwind.x",0,kGDK_3D_DBPro);

dbPositionObject(ObjectCharacters[i],i-14,-10,i*6);
dbLoopObject(ObjectCharacters[i]);
dbSetObjectSpeed(ObjectCharacters[i],100);

}

The second problem is I am getting these errors while building the project -

'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file 'C:\Windows\SysWOW64\kernellbase.dll', Cannot find or open the PDB file.

Thirdly - After loading the .x file the associated textures are not becoming visible. How can I make the textures to appear on the surface of the model ? The model file along with the textures are attached within this message as a zip file for your viewing.

Can anybody please help me out here ?

Attachments

Login to view attachments
Dar13
11
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 27th Jul 2012 02:27 Edited at: 27th Jul 2012 02:29
I'm not sure about the first question, as I don't have a quick DGDK 2.0 test project setup yet. Have you explored using instances or clones instead of unique objects?

Quote: "The second problem is I am getting these errors while building the project -

'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file 'C:\Windows\SysWOW64\kernellbase.dll', Cannot find or open the PDB file."

These aren't errors. It's the debugger telling you that it can't give you detailed information of the specificed DLLs. Those DLLs are the kernel for Windows(aka the backbone of the operating system).

Quote: "Thirdly - After loading the .x file the associated textures are not becoming visible. How can I make the textures to appear on the surface of the model ?"

dbTextureObject([your objectID here],[your imageID here])

Also, just a small note, could you refrain from using unique formatting(italics or bold) for your posts? It's not necessary and I almost misread your post because of it.

Hawkblood
9
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Jul 2012 05:44 Edited at: 27th Jul 2012 05:44
Quote: "could you refrain from using unique formatting(italics or bold) for your posts?"

This happens when you put
Quote: "{"
within the "text" part of a post.
@Juggernaut. To correct this, use the
Quote: " CODE "
button at the top right of the message box.

Now to attempt to answer your question.... Dar13 is correct. You need to instance or clone these objects. I'm guessing these are animated meshes, right? Each time you load/create an object, it "loads" that on-to the video card. As the video card becomes full, windows has to do something known as page-flipping where it takes memory chunks from normal ram and flips it with memory chunks in video ram. This is a costly process-- DON'T DO IT! An instaced object only tells the video card (when rendering the scene) to "use this mesh, in this place, with this orientation, scaling, with the pose currently being used, using the texture already provided with the mesh". Yea, I know, it's definitly a run-on sentence. A cloned object is similar except you have some things that are not nessecarily the same. Namely, texture and pose (pose is the animation pose).

Using clone, or instance for that matter, is quite simple. Load the "original object" and then clone/instance all the others:



The fastest code is the code never written.
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 27th Jul 2012 15:43
"Also, just a small note, could you refrain from using unique formatting(italics or bold) for your posts? It's not necessary and I almost misread your post because of it."

Sorry Dark 13, I will keep it in mind in future. Also thank you for pointing me to the texture command. In the attached .x file, there is two associated texture files (bmp) - one for the head and another for the body. How do I place the textures on the current location of the animated object ? Or does Dark GDK 2.0 takes care of that automatically when I use -

dbTextureObject([your objectID here],[your imageID here])

@Hawkblood: Thank you for the tip on message posting.

And also a big "thank you" for explaining to me the architecture behind object loading and the correct command sets that should be used to create multiple instance of the same animated objects rather than loading it multiple times from the disk and the associated pitfalls.
Dar13
11
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 27th Jul 2012 16:40
Quote: "Sorry Dark 13, I will keep it in mind in future. Also thank you for pointing me to the texture command. In the attached .x file, there is two associated texture files (bmp) - one for the head and another for the body. How do I place the textures on the current location of the animated object ? Or does Dark GDK 2.0 takes care of that automatically when I use - "

If the model is animated and has limbs, you can use the dbTextureLimb command which is similar to the dbTextureObject function. Otherwise I think you'd be better off combining the two textures into a single texture and UV-mapping your model to use that texture.

Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 27th Jul 2012 17:11
"If the model is animated and has limbs, you can use the dbTextureLimb command which is similar to the dbTextureObject function. Otherwise I think you'd be better off combining the two textures into a single texture and UV-mapping your model to use that texture."

@Dar13: Ok Thank you for the advice. I will look into it. I haven't been able to get the textures displayed so far.

@Hawkblood: I do not know about you. But I am getting the same animation slowdown just by creating 50 clones -

Mr Bigglesworth
11
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 27th Jul 2012 17:26
Quote: "But I am getting the same animation slowdown just by creating 50 clones"


Apply the shader to your models in my post here: http://forum.thegamecreators.com/?m=forum_view&t=198922&b=1&msg=2378048#m2378048

It will use the GPU to skin the models instead of the CPU, much faster.
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 27th Jul 2012 17:56
@Mr Bigglesworth: Amazing! Just Amazing! No wonder why they say Dark GDK do not like bones !


Now both the frame rate and animation speed has drastically improved!


Wish I could learn to write shaders like you.
Hawkblood
9
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Jul 2012 18:47
I didn't know GDK didn't like bones....
@Mr Bigglesworth: I am already using Evolved's NormalMapping fx. How could I use this shader of yours to do the same thing? Or do I need to? I want normal mapping, but I want it faster.....

The fastest code is the code never written.
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 27th Jul 2012 19:37
Quote: "I didn't know GDK didn't like bones...."


Oliby said that Dark GDK 2.0 is created on top of Dark Basic Pro code base and inherits all its limitations and pitfalls ( unless Mistrel sorts them out himself ). Dark Basic Pro does not like bones - they said to me within the first few days I joined here. So Dark GDK 2.0 should inherit the same characteristics I guess.

I am still failing to get the two texture displayed over the surface of the animated model.
Brendy boy
13
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 27th Jul 2012 19:47
Quote: " How could I use this shader of yours to do the same thing? Or do I need to? I want normal mapping, but I want it faster....."

you'll need to combine the two shaders into one

Diggsey
13
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 27th Jul 2012 20:09
Quote: "Dark GDK do not like bones"


It's not a question of liking them, it's simply that the calculations required for bone animations are very CPU intensive. Using a shader lets you move most of this work onto the GPU instead. You will find the same characteristics in any engine.

[b]
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 27th Jul 2012 21:52
@Diggsey: It is just a phrase that is being used - it is not technical.
Hawkblood
9
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 28th Jul 2012 02:44
@Mr Bigglesworth: All my attempts to combine ANY shaders have failed. I just don't have the skill. I would be very greatful to anyone that can combine Mr Bigglesworth's fastbone.fx with Evolved's NormalMapping.fx (with multi-lights).

The fastest code is the code never written.
Mister Fuzzy
8
Years of Service
User Offline
Joined: 27th Feb 2011
Location: XNA
Posted: 30th Jul 2012 04:31 Edited at: 30th Jul 2012 04:33
@Hawkblood: Shaders - the final frontier . I wish I knew how to write shaders... My game desperately needs some of it's draw commands moved to the GPU (It runs fine on anything better than an Intel i3, but not everyone has an i7 like me ). I guess I'll need to take a trip to my local library...

ALIEN(S)!!!!!!!!1!! (and sausages)
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 13th Aug 2012 01:41
How do I apply multiple shader files to an animated object without the previous effects getting in-effective ?
Mr Bigglesworth
11
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 13th Aug 2012 02:35
You can't, you would have to combine the shaders.
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 13th Aug 2012 16:16
I see. So unless I have very good knowledge of shader programming there is no way out because if I apply any other shader after your fast bone shader, the fastbone shader stops working.
Dar13
11
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 13th Aug 2012 16:51
Quote: "I see. So unless I have very good knowledge of shader programming there is no way out because if I apply any other shader after your fast bone shader, the fastbone shader stops working."

Yes. What you could do is ask Fallout (his game Carnage is in the WIP section of the forum) for some help, as he has implemented a GPU animation shader with shadows and some other cool stuff.

Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 14th Aug 2012 01:31
@Dar13: Thank you Dark13.

Login to post a reply

Server time is: 2019-05-20 06:08:39
Your offset time is: 2019-05-20 06:08:39