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.

DarkBASIC Professional Discussion / Grid drawing speed

Author
Message
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 5th Feb 2013 17:54
Hey everybody,

I have a fully working grid. For this I use d3dfunc to render the lines in real-time... this however is not the fastest method and when modifying the grid (grid area and size) the fps are dropping way too much to be useful.

Any tips on improving the rendering of the lines?

Thanks!

Regards Sph!nx
www.mental-image.net
Edson
15
Years of Service
User Offline
Joined: 21st Dec 2010
Location: Brasil
Posted: 5th Feb 2013 20:10
You can make a grid of Advanced Terrain and edit this in real-time.

If you like the grid lines, you can use a texture black in center and write in sides.

This form is faster and functionally...

excuse the mistakes, I do not speak English.

Edson, Brazil.

My project is Phenadlax!!!
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 6th Feb 2013 03:08
Depending on the specific requirements of your program, it might be worthwhile to draw the grid onto a bitmap and then just draw that bitmap to the screen every loop. You only have to redraw the actual lines when the grid changes. If that's slow, you could also try drawing the data directly into a memblock to avoid whatever additional overhead the drawing operations are incurring (like antialiasing and rasterizing).

You could also look into using the LOCK PIXELS command, though that may not work with D3D.

Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 6th Feb 2013 12:16 Edited at: 6th Feb 2013 12:16
Thanks guys. I think drawing the grid on a bitmap sounds like a good method for me. I'll give it a go and let you guys know how things turn out!

Regards Sph!nx
www.mental-image.net
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 6th Feb 2013 21:33
Alright, I've been working on implementing a plain with a texture on it to replace the d3d func line commands.

It works, but only to a certain extend. When I zoom out, lines are getting blurred. Pictures show more than words so here are a few for example and comparison.

http://www.deved-portal.com/sphinx/ftp/tgc/test1.png
http://www.deved-portal.com/sphinx/ftp/tgc/test2.png
http://www.deved-portal.com/sphinx/ftp/tgc/test3.png
http://www.deved-portal.com/sphinx/ftp/tgc/test4.png

I've tried many object filter and rendering commands but nothing can stop the blurring of the lines. Any suggestions?

I still believe the d3d func lines could work if it was a little faster. Does anyone perhaps know of any other 3D line dll's out there?

Thanks!

Regards Sph!nx
www.mental-image.net
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 6th Feb 2013 22:16
Yeah, if you need to be able to zoom in and out arbitrarily you probably need to do some kind of draw that goes directly to the screen (d3d line or 2d lines). Though you can try disabling mipmapping on the plane object with set object texture obj,0,0 command, and make sure antialiasing is off with set display mode width,height,depth,1,0. Mipmapping might be causing the object to use a lower-resolution version of the texture when it's far away.

Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 7th Feb 2013 15:25
That did the trick! Thank you very much!

Regards Sph!nx
www.mental-image.net
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 10th Feb 2013 20:19 Edited at: 10th Feb 2013 23:37
I know you've already figured it out, but you may be interested in the following:





Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 11th Feb 2013 00:56
This works good as well. I will fiddle around with it and see if I can use this.

Thanks!

Regards Sph!nx
www.mental-image.net

Login to post a reply

Server time is: 2026-07-07 06:23:14
Your offset time is: 2026-07-07 06:23:14