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.

Code Snippets / "Endless" Terrain example using DB Matrix (highly optimized) [DBP & DBC]

Author
Message
Yarbles
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Toronto
Posted: 18th Apr 2006 05:16 Edited at: 18th Apr 2006 05:19
This is nothing new. I posted this same code ages ago, but I have updated it a bit for DBPro and I noticed, lately, there were some people interested in this around the forums.

Here is an example for reading a height and texture map of any size and scrolling over it using a DB matrix "window". I'm using the level from Axes of Evil for this example.

There is some highly optimized code using the SHIFT MATRIX commands here, as well as a standard refresh of the entire matrix option.

Attachments

Login to view attachments
Yarbles
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Toronto
Posted: 18th Apr 2006 05:21
Grab this one, the last attachment is missing a source code file.

Attachments

Login to view attachments
DrReaper
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location: United States
Posted: 18th Apr 2006 06:50
This is what I was looking for but your code hurts my head. I hope there is an easy way to do this...
Yarbles
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Toronto
Posted: 18th Apr 2006 17:59 Edited at: 18th Apr 2006 18:09
Small update here for the DBPro version.

I cleaned up the code a bit and fixed a few bugs I forgot were in this old version. So cut and paste the source code attachment over the old source file in the zip above.


Easiest way to understand what's happening here is to use and figure what is happening in the _control_matrix_slow: subroutine first (so uncomment it in main loop and comment out the _conrtol_matrix_fast: call). Once you understand that, you will be better ready to handle understanding what is happening in the _control_matrix_fast:, which gives almost a 100% performance boost over _control_matrix_slow: when moving.

Hint: Forcing Anisotropic filtering with your video card settings will get rid of the seams in the matrix. (Still waiting for a function in DBPro to allow for changing those rendering options)

Syncaidius
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 18th Apr 2006 18:21
Great piece of work Yarbles!

You've made more progress than I have made with my memblock terrain, which I cant seem to texture properly at the moment....

Currently working on WORLD, a free world editor for DBP and another world building tool for the OMMORPG project!
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 11th May 2006 18:30
The DBPro one didn't seem infinite to me. It sorta went flat eventually.

jeffhuys
18
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 3rd Jul 2006 19:18
yeah, thats true... HELP ME???

Login to post a reply

Server time is: 2024-11-23 07:36:07
Your offset time is: 2024-11-23 07:36:07