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.

Work in Progress / BlitzTerrain

Author
Message
Chris Tate
DBPro Master
14
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 24th Apr 2013 23:44 Edited at: 24th Apr 2013 23:51
Now I get you; and I saw the post you made in the other forum.

But teach me why is it necessary for the reflection camera to not remain at the water level? Isn't it the water surface itself that is to receive a reflection from itself? at its Y position? What happens when the camera goes really high, will you start seeing fish?

I'm not up to speed with camera logic at the moment, I just want to understand.

You've got me wondering now...

When you look at a mirror from an angle, from far away, that reflection doesn't pull back; so why is this so with water? If you look at a mirror from an angle, the direction of the light that reaches your eye is different which reflects a different field of vision, but the point of reflection is still on the mirror.

Chris Tate
DBPro Master
14
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 24th Apr 2013 23:52 Edited at: 24th Apr 2013 23:59
Now I get you; and I saw the post you made in the other forum.

But teach me why is it necessary for the reflection camera to not remain at the water level? Isn't it the water surface itself that is to receive a reflection from itself? at its Y position? What happens when the camera goes really high, will you start seeing fish?


I'm not up to speed with camera logic at the moment, I just want to understand.

You've got me wondering now...

When you look at a mirror from an angle, from far away, that reflection doesn't pull back; so why is this so with water? If you look at a mirror from an angle, the direction of the light that reaches your eye is different which reflects a different field of vision, but the point of reflection is still on the mirror.

Mobiius
Valued Member
19
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th Apr 2013 23:53 Edited at: 24th Apr 2013 23:56


Looking at that picture, we are looking through camera 0. We can see the terrain, and a reflection of the terrain on the waters surface.
The image which is being textured into the water is taken from a camera at the same position as camera 0, but at a mirror angle to it. this camera looks up (at a mirror image) and that is whats pasted onto the water.

I'm not doing a good job of explaining it am I...


Are you aware of how the portals in portal work? The reflection image works kind of the same way.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Chris Tate
DBPro Master
14
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Apr 2013 00:05
Quote: "the water is taken from a camera at the same position as camera 0, but at a mirror angle to it. this camera looks up (at a mirror image) and that is whats pasted onto the water."


Yeah.. I mentioned the angle, all clear. But what I wanted to know about the position; why would the position of camera 1, or whatever number the reflection camera is, not be at the same level as the water?

Quote: "The reflection camera for the water shader needs to be underwater yes."


That's the part my brain does not want to accept; no matter how hard I try. Or was it a mistaken message.

Mobiius
Valued Member
19
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th Apr 2013 00:07 Edited at: 25th Apr 2013 00:56
I'll try and make a video which will explain it and edit this message with it.. Hang on.....

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Mobiius
Valued Member
19
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th Apr 2013 00:56 Edited at: 25th Apr 2013 00:56
Here it is. It's not the best demonstration, but I hope it helps.



The plain in the middle of the screen is what the reflection camera is seeing.

Notice when we are below the water, both the main image and the reflection image are the same. (This is so you can see what the reflection image looks like when we are under the water level)

As the main camera moves up, we see how the reflection image stays under the water level.

We can see as we move the camera how the reflection image changes.

When we rotate the reflection plain to match the water, we can see that the reflection image now matches the reflection we see on the water plain.


I hope this helps explain why the reflection camera needs to be the underwater level...

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Green Gandalf
VIP Member
18
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Apr 2013 01:02 Edited at: 25th Apr 2013 01:04
Or you could use a simple 2D drawing:



The upper purple dot represents the viewer above water. The lower purple dot represents the reflection camera. The two red dots are points in the scene that get reflected at the surface. The lines joining the dots represent the direction of rays of light from the objects to the two cameras.

Attachments

Login to view attachments
Mobiius
Valued Member
19
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th Apr 2013 01:04 Edited at: 25th Apr 2013 01:09
lol, There's that way I guess....

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Chris Tate
DBPro Master
14
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 25th Apr 2013 10:09
Thanks guys, the simple drawing registered in my brain now. The reflection takes place where the line of sight of both cameras meet which is on the water surface. The camera has to move down for technical reasons not because the reflection takes place at the camera. Hope I've got that right.

kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 4th May 2013 15:15 Edited at: 8th May 2013 17:33
Hey everyone,

I have a couple more design ideas for BT-next I would like to run past you:

I will be changing the name of BlitzTerrain. I haven't got a new name but for now I will just refer to it as BT-next. Any ideas for a new name are very welcome

Firstly, I hope to remove the need to use a DBPro object id with a terrain. This has caused tonnes of confusion in the past as a BlitzTerrain is not actually a DBPro object. I did this so I didn't have to implement loads of functions for things such as moving, rotating, etc


My Second idea is a system to easily store IDs for terrains, so you don't have to keep storing IDs everywhere

I will add an optional parameter to the BT make terrain function. This will be the name of the terrain. You can get and set this at any time



The old way of creating terrains into an ID will be supported as well




There will be no DBPro object tied to a terrain. I will reimplement all the basic 3D functions that can be used on a terrain. (don't worry, most of the code for these will be automatically generated, so bugs are less likely to be added)


I will release the API documentation before the first beta of BT-next. The first beta will be versioned 0.1. All releases with version 0.x.x will have an unstable API, meaning it may break your code between new releases. When version 1.0.0 is released, the API will not have any backwards incompatible changes. If a backwards incompatible change is absolutely necessary, I will increase the major version to 2.x.x and so on. Hopefully this will happen very rarely though. Doing versions this way makes it easier for developers to update as you know that your code will work in the new version (as long as the major version is not unchanged of course)


Another idea is setting/getting vector functions will have lots of different versions for different ways of setting them:



Flamertor
11
Years of Service
User Offline
Joined: 12th Oct 2011
Location:
Posted: 4th May 2013 16:32 Edited at: 4th May 2013 16:34
Love the sound of the new features and can see some great use for them. If it isn't to much to ask could you work on a drawer which instead of just using colours it uses textures as well? And a way to save it.

Love BlitzTerrain
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 4th May 2013 18:37
@kaedroho

it makes sense to change the name

with all the things that have changed and will change
a different name should reflect that

I have only seen a couple of addition that were not DBP depend
so I can see why you wanted to go that way

the more wider the audience you cover the more interest you will have
in people wanting to get it

we all know one of the new features you are working on adding
is the ability to great a 3d globe mass

so some of the name should have reference to that
which would aid in people being more interest in getting it

with "LeeBamber" considering rebuilding DBP
calling it "Dark Basic Elite" or simlar

it would contain directx 10 and directx 11 and the posoblity of
opengl

I know some sum time ago created a opengl addition for DBP
but it looks like it did not came to end just as quick

with the new "BT-next" as you are momentarily calling it
the next DBP would rile give it a leg up give or take
changes you would need to get it working with it

DBP still has a lot of life in it
it's nearly ware it should be

c++ and a like is way beyond me and there are just too many thing
to things that rile do not help in the understanding when your stuck in the basic level

one thought for a name is

W-O-Terrain - Wide - Open - Terrain

since it's now will have the ability to created planets

to move side ways - is to move forward
Since a Strait line gets thin fast
Duffer
19
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 4th May 2013 20:28 Edited at: 4th May 2013 20:29
@ Kaedroho,

Good to hear from you on the forums, and with an update!

All sounds good.

I'd just echo Flamertor - some useful brushes and some really handy texture and detail texture commands coupled with the much heralded spherical terrains....

Also, if it is no longer based on DB objects (which makes sense) what about application of shaders in DBPro?

Will you still be able to manipulate terrain shape and colour/texture on-the-fly?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Green Gandalf
VIP Member
18
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th May 2013 23:40
Quote: "I hope for 100% compatibility with Advanced Terrain on shaders."


I'm not convinced that is a good idea. It's not easy to get certain things to work correctly with AT - I think you should aim for BT to be as simple as standard DBPro objects not as complicated as it is for AT objects.
kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 8th May 2013 17:41
Green Gandalf,

Thanks for the suggestion. I'll have to do some research into the best way to do shaders instead of copying AT


I have a couple of questions for anyone who has written shaders for advanced terrain:
What things are hard to get working with AT?
Do you have any requests for things that BT must provide for shaders?

kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 16th May 2013 01:05
Please post code or I can't help you

MrValentine
AGK Backer
12
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 16th May 2013 06:21
I think you can ignore him, he is also on this thread:

http://forum.thegamecreators.com/?m=forum_view&t=135855&b=5

Duffer
19
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 18th May 2013 11:46
@ Kaedroho,

On a brighter note, how goes your development of BT3?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Duffer
19
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 28th Jun 2013 18:07
@ Kaedroho,

Any further news on BT3? Please tell me this is still being developed.....

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
gwheycs62egydws
13
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 30th Jun 2013 21:41 Edited at: 1st Jul 2013 00:26
@Duffer

as we all know it's summer

so some of the work continues

but not until the warm weather go's will there not
be any more major activity ;o(

it will be ready when it's ready ;o)

to move side ways - is to move forward
Since a Strait line gets thin fast
Alquerian
16
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 1st Jul 2013 22:41
You have really come a long way with this! Very cool work, it has been quite a while since I have been on. Glad to see this has progressed very well
kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 19th Jul 2013 15:30 Edited at: 19th Jul 2013 15:40
Sorry for not being around recently. I left 3 assignments to the last couple of months of the semester (bad idea!). Then I had to do a couple of weeks of jury service.

I've been working on the DBPro plugin and DirectX renderer for the past couple of days, nothing to show yet but will hopefully have something to show soon.

There will be two DirectX 9 renderers with room to expand to DirectX 10/11 and also OpenGL (Obviously, these won't be available to DBPro users).

The two DirectX 9 renderers will be called "D3D9-Legacy" and "D3D9-SM3". The D3D9-SM3 one will use a much faster method of rendering but will require a GPU with shader model 3 to be installed. The legacy one will render with a similar method to what BT2 does and should work fine on all DirectX 9 compatible hardware.

The renderer will be automatically chosen based on weather the users computer supports shader model 3. There will be a command available to allow you to force it into legacy mode if you want (like if you have a shader that is incompatible with the new renderer for example).

Let me know what you think of all that, I'll get on with writing this plugin


PS: Lee has been blogging about putting BlitzTerrain in FPSC Reloaded! http://fpscreloaded.blogspot.co.uk/

MrValentine
AGK Backer
12
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Jul 2013 16:08 Edited at: 19th Jul 2013 16:12
Quote: " There will be a command available to allow you to force it into legacy mode if you want"


Precisely how things should be done, good job and looking forward to seeing what comes of BT3, I am yet to toy with BT2 however...

EDIT

However, how about forcing SM3 as well?

kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 19th Jul 2013 16:20
Quote: "However, how about forcing SM3 as well?"


SM3 will be used by default. It will only not be used if the users hardware cannot support it or if its been forced into legacy mode

The answer to that basically is: Don't force into legacy mode!

Juggernaut
10
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 20th Jul 2013 08:20
kaedroho: Can you please explain the HDR and Water rendering feature available in Blitzwerks Terrain 2 ?

How long will it take to create BT3 ?

What will be the largest terrain size supported by BT 3 ?

Will it be possible for you to implement continuous terrain streaming ?
Duffer
19
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 20th Jul 2013 11:58
@ Kaedroho,

Great to see you on the forums again. Also, fantastic to hear BT3 still being developed.

Will BT3 be supporting-

- terrain streaming;
- spherical terrains (that ole chestnut);
- and/or rttms?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 20th Jul 2013 21:54
Juggernaut,

Quote: "Can you please explain the HDR and Water rendering feature available in Blitzwerks Terrain 2?"


Neither water or HDR are done by the terrain engine. BT2 should work well with existing methods of doing these which can be found elsewhere on the forum.

I created a demo a while ago which contains a BT2 terrain working with water. I haven't got any for HDR though
http://forum.thegamecreators.com/?m=forum_view&t=164760&b=1


Quote: "How long will it take to create BT3?"


I can't make any accurate predictions (I cannot see in to the future!). I'm hoping that I will have a demo to show soon and a release by the end of the year


Quote: "What will be the largest terrain size supported by BT 3?"

Pretty much infinite. BT3 will be able to stream terrain in on the fly so the only limit is the disk space

Technically, there is a limit. But its about 4.2 billion tiles each way

Without terrain streaming, a 16k x 16k tile terrain should be possible to load fully into RAM on a 4GB RAM PC


Quote: "Will it be possible for you to implement continuous terrain streaming?"


Yep!




Duffer,

Thanks for the comment and also thanks for all the support you have given the project over the years. Your support (and many others on this forum) is greatly appreciated and its people like you that keep this project going


Quote: "Will BT3 be supporting-"


Quote: "- terrain streaming;"


Yes

Quote: "- spherical terrains (that ole chestnut);"


This is a maybe, I have found it difficult to design an API that allows both flat and spherical terrains while keeping it clean. I'll keep looking into this though

Quote: "- and/or rttms?"


Yes

Juggernaut
10
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 21st Jul 2013 11:02
kaedroho:

Will BT 3 continue to have all the features of BT 2 ? Or will there
be some drop in features ?

What is spherical terrain and "and/or rttms" ?

How many layers of textures will BT3 support ?

Will I be able to assign shaders to each individual layers of the textures used on BT 2 or BT 3 terrains ?

Does BT2 support detail mapping ? Will BT3 support detail mapping ?

If I buy BT 2 now, do I get BT 3 free or will there be an upgrade fee ?
Duffer
19
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 21st Jul 2013 11:04
@ Kaedroho,

Lot's of questions... hey?

Happy to lend (moral) support til the plugin is completed and then (financial) support by buying it....

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 21st Jul 2013 15:27
Quote: "Will BT 3 continue to have all the features of BT 2 ? Or will there
be some drop in features?"


The only feature I'm thinking of dropping at the moment is quad reduction. It was a real pain to implement!

Quote: "What is spherical terrain and "and/or rttms"?"


Spherical terrains are sphere shaped terrains. These are used for drawing high detail planets which are very useful for space games

RTTMS stands for "Real Time Terrain Modification System". Its the name of a plugin that is part of BT2 that lets you edit BT2 terrains in real time


Quote: "How many layers of textures will BT3 support?"


I'm not fully decided on this one yet. I'll answer this one when I get to developing the texturing system


Quote: "Will I be able to assign shaders to each individual layers of the textures used on BT 2 or BT 3 terrains?"


Shaders will be assigned to an entire terrain. As far as I know, DirectX doesn't let you assign a different shader to a texture on a terrain. You can, of course, combine all your shaders into one and apply them all to the terrain

Quote: "Does BT2 support detail mapping? Will BT3 support detail mapping?"


Answer to both of this is yes

Quote: "If I buy BT 2 now, do I get BT 3 free or will there be an upgrade fee?"


I haven't got round to thinking about this yet. When I have the terrain system nearly finished, I will begin talks with TGC on how it will be sold on their website. Thats when I plan on making this decision.

If you only want BT3 then you should wait until the release of BT3 just to be sure that you don't pay more than you need to

Juggernaut
10
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 21st Jul 2013 21:35
Quote: "I haven't got round to thinking about this yet. When I have the terrain system nearly finished, I will begin talks with TGC on how it will be sold on their website. Thats when I plan on making this decision.

If you only want BT3 then you should wait until the release of BT3 just to be sure that you don't pay more than you need to"


Will you consider a discount or a reduced fee structure for the persons who will buy BT2 now, so that they do not have to pay more ?

I am asking this since release of BT3 will take another 6 months as
hinted by you and I want to start with my game with no delay.
kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 21st Jul 2013 22:12
Quote: "Will you consider a discount or a reduced fee structure for the persons who will buy BT2 now, so that they do not have to pay more?"


Yes but I can't make any promises at the moment, I would really like to discuss this with TGC first.

Quote: "I am asking this since release of BT3 will take another 6 months as hinted by you and I want to start with my game with no delay. "


I appreciate that but if you don't want to risk buying two copies of BlitzTerrain then you should stick to the free version


Remember that BT3 isn't an update to BT2. Its a total rewrite from scratch with a brand new API and engine underneath, so its basically a completely new product. I would like to discuss this with TGC before deciding as they have been in this situation many times before and would know the best option for everyone

Everyone, please feel free to add your two cents on what you think would be best

kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 24th Jul 2013 11:21
I've just started a blog! I'm going to use it to post updates about the development BlitzTerrain 3 and also general BlitzTerrain related stuff

http://blitzterrain.blogspot.co.uk/

Juggernaut
10
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 28th Jul 2013 03:30
How much will BT3 cost ?

If the price is too high, will BT2 still be available for purchase ?
kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 30th Jul 2013 00:38
Juggernaut, both of those are TBD at the moment, I'd like to get it finished before I stick a price on it

I've decided that I'm going to do two more BlitzTerrain 2 releases. The first one will be an internal cleanup and will have some features removed. I hope to solve every last bug with BlitzTerrain in this release

The release after that will have a cleaner API, updating to this version will break your code so I will make sure both versions are available. This version will be recommended for all new projects as there will be a much easier api to work with

MrValentine
AGK Backer
12
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 30th Jul 2013 04:05
Quote: "This version will be recommended for all new projects as there will be a much easier api to work with"


More than happy with that as I am yet to begin using BT, just wanted to buy it when I did in order to help you kick along with BT3

Kezzla
14
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 30th Jul 2013 10:52
Kaedroho,

for your next BT2 release could you maybe include the ability to manipulate a saved terrain?.

Raise/lower/flatten terrain commands only work when loading a terrain from a heightmap. For my level editor I would like to be able to save the terrain and then reload it and continue manipulating it.

At the moment I am running a subroutine to create a new heightmap upon save, its far from perfect and pretty slow but it works.

Is there anything you can do to implement a solution within the DLL?

cheers
Kezzla

I'm not a complete idiot -- Some parts are just missing.
kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 30th Jul 2013 11:30
Just so you guys know, the two new versions will be called 2.03 (the cleaned up one) and 2.04 (the cleaned up one with a new api)

Kezzla,

In 2.03 I'm complely removing the save/load terrain commands. Instead, I'm writing a export heightmap command which will simply turn your terrain back into a DBPro image so you can save it

Kezzla
14
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 30th Jul 2013 12:38
Sweet. I look forward to your update.

cheers mate.

I'm not a complete idiot -- Some parts are just missing.
KISTech
14
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 2nd Aug 2013 21:39
Kaedroho,

So glad this project is moving forward. For the last 2 years I've been off trying to start a Sports Photography business and it's evident that I'm not going to be able to break into the existing client base for years to come.

I'm returning to game development and I'm looking forward to working with your stuff again. If you have room for another tester, I'm available to help out again.

Can't wait to see streaming. Been chomping at the bit for years on that..

kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 3rd Aug 2013 00:12
Hi KISTech, its great to see you again!


I've been working on stripping down the current system recently, details in the link below:

http://blitzterrain.blogspot.co.uk/2013/08/status-update.html

Kezzla
14
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 4th Aug 2013 09:40 Edited at: 4th Aug 2013 09:41
Hi Kaedroho.

I have a function that I find to be pretty handy and I thought I would share it here,(I guess this thread is the best place)
It is a function that uses a color map to randomly place items on a terrain. Its good for placing generic things like trees.

Scattermap(terrainID,imageno,color as dword,tolerance,resolution,folderpath$,objectrangemin,objectrangemax,scale#)
terrainID = terrain id
imageno = the number of the loaded image you wish to use as a map
color = the target color
tolerance = how strictly the color is matched eg red value = 100 +-10
resolution = reading every single pixel in the image can take a while and is not always necessary, you can make it skip lines of pixels
folderpath = a folder which will hold your media. the function will find every model in the folder and randomly scatter it all over the terrain(where colormap dictates).
objectrangemin = start of object range
objectrangemax = highest numbered object it will create. these two values determine the object count and are here because not everyone has matrix1 utils and find free object functions.
scale = the scale of the terrain

here is the code

anyone can use and alter this function as they see fit
I have attached an example project for people to look at.

maybe something along those lines would be a good feature for Blitzterrain.

Kezzla

I'm not a complete idiot -- Some parts are just missing.

Attachments

Login to view attachments
Chris Tate
DBPro Master
14
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Aug 2013 16:21 Edited at: 4th Aug 2013 16:39
Following on from Kezzla, I also have some code that might inspire some ideas for features. The concept here is to treat the terrain as a series of individualized tiles, each tile contains their own shader, texture and vertex dense structure.

Besides providing an unlimited amount of detail and variation; it is also means for associating events with terrain locations. For example, one tile could represent quicksand, and another could represent rock; each would fire their own event trigger when the player stands on them.

I have demonstrated this idea in a TGC code snippet entry; and will illustrate it again here.


Quote: "---- Requires Matrix1
---- Uses VertexData, Memblock and Vector3 Commands

Known issue: Some PCs might display nothing on the screen at first; just move forward, for some reason DBP's culling system thinks the terrain is not in the screen.

This snippet features a surface object I am using in my game. Here it is being used as a terrain which has event handling and shaders in mind. The terrain is broken down into a series of limbs and has meta-data such as walking speed and item drops for tiles in the terrain.

Rather than being a huge single limb in-explicitly described object, the surface is defined as an array of limbs that can be treated individually, given seperate shaders and properties. You can also apply a single shader to the whole object and supply separate textures for each tile.

The surface can be used as water by animating the vertices in the loop. The smoothness of the generated mesh can be improved by increasing the Quality variable, increasing the size of the heightmap and making use of Vector3 interpolation commands or vertex shaders. The tiles are not simply single polygons, but sub-terrains, so realism can be simulated effectively.

To create LOD, create two or more surfaces at different levels of detail and either convert limbs to objects, then use the Add Lod To Object command; or you can keep the limbs intact and manually fade transition the limbs nearest to high quality, and the limbs far away in low quality.

The example features a simple game of search and find. There are some hidden objects located in the map. The walking movement demonstrates variable walk speeds and object intersection.
Each tile could also implement footfall sounds. Crouch is activated by pressing spacebar.

It would be a good idea to cook the mesh using a PhysX plugin to perform hardware accelerated collision; creating a low poly surface to act as a hidden collision object.

Post up any comments or suggestions."


Code:




kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 6th Aug 2013 15:52 Edited at: 6th Aug 2013 16:21
Hi everyone,

Just looking to get some feedback on some new functions

I've removed the need to create a DBPro object for a terrain to simplify the API. This DBPro object was used mainly to allow things like positioning, setting shaders, etc to happen easily.

Now, I'm creating functions to do various things to a terrain instead of using the DBPro object. My current list is as follows:



Let me know if there are any more functions you will need

Another change that I would like to make, and this will apply to the above list of functions, is to add spaces between all the words in the commands. This makes the API more consistent with DBPro

For example: BT BuildTerrain becomes BT Build Terrain

Let me know what you think of that too!

Thanks in advance


My cleanup of BlitzTerrain is nearly at an end. So far 4,356 lines have been removed and 547 lines have been changed

KISTech
14
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 6th Aug 2013 18:46
I like all of it. Including the DBPro command spacing.

I'm not sure why, but I like the spacing. It makes it easier to read.
MrValentine
AGK Backer
12
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 6th Aug 2013 18:49
I like the fact that the Intellisense will work better that way...

Juggernaut
10
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 8th Aug 2013 09:29
kaedroho: Does Blitzwerks terrain support texture splatting or multitexturing through code at run-time, I mean any in-built
functions available for that ? How many texture layers are supported ?

Is it possible to add shaders to each individual texture layers of the
Blitz terrain through code at run-time in order to increase the surface details of the terrain surface ?

A placement editor to place trees, grass, foliage, vegetation, and other game objects on the terrain surface visually would be nice.

What is the largest heightmap resolution and texture resolution that
the Blitz Terrain supports ?
kaedroho
15
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 8th Aug 2013 21:43 Edited at: 8th Aug 2013 21:46
KISTech and MrValintine, Thanks for the comments, I'll hopefully have a command list out soon! (and maybe even a beta...)

Quote: "kaedroho: Does Blitzwerks terrain support texture splatting or multitexturing through code at run-time, I mean any in-built
functions available for that ? How many texture layers are supported ?"


Not natively, but this can be done in a shader. How many layers are supported really depends on the shader

Quote: "Is it possible to add shaders to each individual texture layers of the
Blitz terrain through code at run-time in order to increase the surface details of the terrain surface ?"


Same answer as above

Quote: "A placement editor to place trees, grass, foliage, vegetation, and other game objects on the terrain surface visually would be nice."


Yeah, it would. But it would probably be quite a lot of work too

Quote: "What is the largest heightmap resolution and texture resolution that
the Blitz Terrain supports ?"


512x512 for the free version and 4096x4096 for the full version. BT3 will support streaming so the only limit would be the size of your hard drive

Juggernaut
10
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 8th Aug 2013 23:07
Quote: "KISTech and MrValintine, Thanks for the comments, I'll hopefully have a command list out soon! (and maybe even a beta...)

Quote: "kaedroho: Does Blitzwerks terrain support texture splatting or multitexturing through code at run-time, I mean any in-built
functions available for that ? How many texture layers are supported ?"

Not natively, but this can be done in a shader. How many layers are supported really depends on the shader"


Can you please provide us such a shader confirming to Shader Model 2.0 that will give us texture splatting capabilities up to 16 layers
of textures ?

Quote: "

Quote: "A placement editor to place trees, grass, foliage, vegetation, and other game objects on the terrain surface visually would be nice."

Yeah, it would. But it would probably be quite a lot of work too

"


If a placement editor is a lot of work, can you please provide us
a function which takes an image file, a color code in hex and an object id or sprite/billboard and place the object or sprite / textures on the terrain surface at locations specified in the image file using passed in color value. ?

What is the minimum hardware requirement - processor and gpu for smooth working of BT ? Will it work on on-board graphics ?
Kezzla
14
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 8th Aug 2013 23:50
Quote: "If a placement editor is a lot of work, can you please provide us
a function which takes an image file, a color code in hex and an object id or sprite/billboard and place the object or sprite / textures on the terrain surface at locations specified in the image file using passed in color value. ?"


Take a look a few posts back at the code I posted. It does exactly this. with very little alteration it can be made to only clone one object, but at the moment it is best used by having a folder full of eg. foliage models, this will load an imagemap and scatter the random models on the terrain in random locations dictated by the color of the trigger pixel.

Burn retina, burn!

Login to post a reply

Server time is: 2023-02-08 07:21:58
Your offset time is: 2023-02-08 07:21:58