Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Landscape rendering too slow  (Read 891 times)
Aweb
Community Member
*
Posts: 11


« on: January 02, 2012, 08:10:06 AM »

Hello!

I'm currently developping a paging engine in order to have big terrains without too much a performance loss.

It works mostly okay except for the FPS.

When comparing to this Paging demo on the TV3D samples blog, it seems like I have around 8 times less FPS than it.

I analyzed the problem with the TV3D profiler on both projects and here's what I get :
On the Terrain Paging demo (not mine) :


On my project :


So it seems like Landscape rendering is the big problem here.
Considering I enabled LOD exactly the same as the other project and my terrain size is roughly the same, I really don't know where it could come from...

Does somebody have an idea about what could cause this problem?
Thanks in advance !
« Last Edit: January 02, 2012, 08:31:00 AM by Aweb » Logged

C# and VB.Net developper trying to work with TV3D
SylvainTV
Administrator
Community Member
*****
Posts: 4946


WWW
« Reply #1 on: January 02, 2012, 06:52:45 PM »

Looks like it's rendering and calculating too many things for landscapes.

Check the "farplane" of the camera
And the amount of paging (maybe post the actual land creation code here)
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Aweb
Community Member
*
Posts: 11


« Reply #2 on: January 04, 2012, 02:21:39 PM »

First, thanks for the answer !

Yes, that's my guess as well, but I can't seem to change this amount, even when I tried playing a bit with the Farplane values (it even seemed to be worse)...

My code is available here (that's not a problem since I was planning on making it public anyway) but it's not final so it's not very clean.

If you don't want to have to check the whole code, every tile's landscape is created this way :
Code:
Landscape = GlobalVars.GameEngine.Scene.CreateLandscape("Land" + TilePosition.TileX + ";" + TilePosition.TileZ);
            Landscape.GenerateTerrain(null, CONST_TV_LANDSCAPE_PRECISION.TV_PRECISION_HIGH, TileSize, TileSize, TilePosition.TileX * 256 * TileSize, 0, TilePosition.TileZ * 256 * TileSize);
            Landscape.EnableLOD(true, 100, CONST_TV_LANDSCAPE_PRECISION.TV_PRECISION_ULTRA_LOW, 0, true);
            Landscape.SetCullMode(CONST_TV_CULLING.TV_BACK_CULL);
            Landscape.SetCollisionEnable(false);

Thanks in advance !
Logged

C# and VB.Net developper trying to work with TV3D
Shargot
Customers
Community Member
*****
Posts: 166


WWW
« Reply #3 on: January 04, 2012, 05:18:31 PM »

SylvainTV  what is enableTL in Init3DWindowed function ?
and why fps higher whan it true ??

(this is answer to this problem Smiley)
Logged

" width="130" height="45" border="0
Aweb
Community Member
*
Posts: 11


« Reply #4 on: January 04, 2012, 05:35:42 PM »

Well I was using the code from TV3D 6.5's landscape tutorial from TV3D samples which specifies
Code:
TV.Init3DWindowed(GameHandle, false);
the problem is that it disables "enableTN" which otherwise is enabled by default. Considering it "basic" code, I never bothered to check it.

Thanks to Shargot who found the problem (he made the code that inspired me!) and was very helpful, I now passed from 250 to 1250 FPS on my home PC!

A screenshot in order to show the change (CTVLandscape::Render doesn't take 75% of CPU time any more) :


PS : That's all I was able to find about "enableTL" : http://www.truevision3d.com/forums/tv3d_sdk_65/enabletl_in_init3dwindowed_function-t13567.0.html
Logged

C# and VB.Net developper trying to work with TV3D
jviper
Community Member
*
Posts: 2130

Discipline in training


« Reply #5 on: January 05, 2012, 05:42:21 AM »

This does not seem to run on my system. I'm getting Access Violations everywhere. MTV3D65 just stops rendering and it gives me no errors. I'm running Windows 7 Ultimate 64 bit.

EDIT: After farther look, it seems it keeps creating new landscapes over and over at tile 0,0, and never destroying. Is it supposed to do that?
« Last Edit: January 05, 2012, 05:48:33 AM by jviper » Logged

JAbstract.....Don't just imagine, make it happen!
Aweb
Community Member
*
Posts: 11


« Reply #6 on: January 05, 2012, 08:40:55 AM »

Ouch. Nope, I can assure you it isn't supposed to do this :/
I'm using Win7 x64 with VS 2010 on two different computers and it works on them. What's your hardware configuration?

Please try this one : http://dl.dropbox.com/u/77072/Worldengine.rar
If it works, that's cool. If it doesn't, please copy the contents of the WorldEngine-debug.txt file.

Thanks for your time, I hope I'll be able to fix this.
Logged

C# and VB.Net developper trying to work with TV3D
arnienet
Customers
Community Member
*****
Posts: 263


WWW
« Reply #7 on: January 07, 2012, 12:02:24 AM »

TNL or enableTL should refer to enable hardware transform and lighting, so when enabled, matrix transformations and lighting calculations are performed on the optimised GPU instead of the CPU, hence the much higher fps Smiley
Logged

Total Dev time = 50% to code, 50% to test, 50% to find errors, 50% to fix, that's why it takes twice as long.

Dawn World MMO
Aweb
Community Member
*
Posts: 11


« Reply #8 on: January 11, 2012, 07:57:59 PM »

Indeed, thanks a lot for the answer !

By the way, my project is accessible on gitHub now : https://github.com/Aweb/WorldEngine
If you have any enhancements or fix ideas, don't hesitate !
Logged

C# and VB.Net developper trying to work with TV3D
arnienet
Customers
Community Member
*****
Posts: 263


WWW
« Reply #9 on: January 11, 2012, 08:56:48 PM »

No problem, I downloaded your project, but it freezes after about 10-15 secs, both in the debugger and exec. It might be something to do with the x86 CPU target. TV3D needs this and setting it brought out some bugs.

Error   1   Default parameter specifiers are not permitted   C:\Users\Ade\Desktop\Aweb-WorldEngine-b995efd\Aweb-WorldEngine-b995efd\WorldMap.cs   40   40   WorldEngine

cheers.
Logged

Total Dev time = 50% to code, 50% to test, 50% to find errors, 50% to fix, that's why it takes twice as long.

Dawn World MMO
Aweb
Community Member
*
Posts: 11


« Reply #10 on: January 12, 2012, 06:24:47 AM »

Well it was always normally set on x86 target because TV3D doesn't works with x64.
I found a few bugs (missing textures, out of bounds parameters for the lens flare...) in the log but nothing "serious" (I fixed them).

What exactly were you using to test this? I'm using Visual Studio 2010 and I don't see this bug :/
Logged

C# and VB.Net developper trying to work with TV3D
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks