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 / Problem with .png texture and FPS performance

Author
Message
Craythur
15
Years of Service
User Offline
Joined: 9th Feb 2009
Location: Costa Rica
Posted: 11th Feb 2009 02:25
Hi everyone
This is my first ask for help in this forum.

This is my problem: I’m using a 3D model generated with Plant Life, this model has a .png texture. I used the dbSetAlphaMappingOn and the dbGhostObjectOn, with this commands the 3D model makes the .png texture transparent in the places it is supose to be transparent, that´s OK. But, when the camera gets near the object the FPS drops down dramatically from 75 FPS TO 37 FPS. How can I avoid this FPS drop? Is there another way to import an .X model with transparent .png texture in Dark GDK?

Im using the dbSetWindowOff(); command.
Here´s the code of how im importing the .x model in the game.

dbLoadObject ("fern1.X", 300);
dbRotateObject (300 ,0 , 0 , 0 );
dbSetAlphaMappingOn ( 300,100 );
dbGhostObjectOn ( 300,6);
dbPositionObject (300,30000,420.0f,49000);
dbScaleObject (300,1000,1000,1000);


please help!

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 11th Feb 2009 09:26
Additive blending(dbGhostObjectOn()) is quite slow and if this brings down your FPS a lot for a single object then you must have quite an old GPU(or a mesh with ungodly amount of triangles). For this and generally all foliage you should use 1-bit alpha as it requires no frame buffer reading when drawing the triangles. i.e. use dbSetObjectTransparency( ID, 1 or 4 ). Yes it may not look as good but get some higher res textures or something as that's the best way to handle it.

Craythur
15
Years of Service
User Offline
Joined: 9th Feb 2009
Location: Costa Rica
Posted: 11th Feb 2009 17:22
Hi Dark Coder,

First of all, thank you for answering

I have new results with the dbSetObjectTransparency( ID, 4 ) command. This improve the FPS a little with my original .x object (fern1.x). But I realize that this object is to heavy for my game. Here´s an attached image of the fern1.x in my game.


In that image, i wasn’t using the dbSetWindowOff() command. If I do, the FPS goes from 75 FPS to 40 FPS. The dbSetWindowOff() has huge effects in the FPS.

So I used another .x object, this one has a simpler .png texture (also, the plant has like 5 rounded leafs) and this has a fantastic result using the dbSetWindowOff() command. The FPS goes from 75 to 73, and that’s a big improve. I think using complicated .png texture, like the one in the image, affects a lot the FPS.

By the way, im using the NVIDIA e-GeForce 8400 GS 512MB. I believe this is a good video card, is it?

Thanks

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-30 17:32:39
Your offset time is: 2024-09-30 17:32:39