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
Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 8th Mar 2011 04:11
Is the full version of the GDK version for sale? Couldnt find it on the website..


Making dreams possible, one line at a time...
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 8th Mar 2011 12:22 Edited at: 8th Mar 2011 12:22
Not yet. I am hoping to get it up soon. I will get to work on it once the 2.2 update is out which will be in the next couple of weeks.

Its a bit buggy at the moment and theres no headers for the latest version.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 17th Mar 2011 15:16
how do you know the height of each vertex?

VitebskStar@tut.by
mobil MTS: +375 29 895-98-82
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th Mar 2011 17:00
You can use BT GetGroundHeight to get the height of a vertex. I have added a flag in the update (coming later this month) which rounds the position to the nearest vertex so it can be used accurately with BT SetPointHeight.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 17th Mar 2011 17:10
Thanks, I'll wait for an updated version of ...

VitebskStar@tut.by
mobil MTS: +375 29 895-98-82
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 17th Mar 2011 17:15
...more examples, then it is understandable

VitebskStar@tut.by
mobil MTS: +375 29 895-98-82
Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th Mar 2011 19:30
When will there be a GDK release?


Making dreams possible, one line at a time...
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th Mar 2011 20:11
Hopefully next month. Theres some really difficult bugs in it at the moment which I need to solve first.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 18th Mar 2011 14:27
Have you thought about using Blendmapping to allow multiple textures for blitzterrain? I believe DX9 supports upto 8 unique textures for an object and this would be great because it would provide a route to multitextures without the need of shaders

Also, I would like to know if there is a GDK version out that I can possibly use till you finish the one you are working out since Blitz is the primary terrain renderer for my game


Making dreams possible, one line at a time...
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 18th Mar 2011 20:25
kaedroho, how to find the coordinates of the point of intersection of a terrain?

please an example

VitebskStar@tut.by
mobil MTS: +375 29 895-98-82
_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 18th Mar 2011 20:45 Edited at: 18th Mar 2011 20:45
Quote: "I would like to know if there is a GDK version out that I can possibly use till you finish the one you are working out"


I'd like to know that too. I once downloaded the BlitzTerrain200GDKBeta2.zip but that doesn't seem to work at all. Even the demos that came with it show nothing on screen...
I'm so looking forward to using BlitzTerrain in my DarkGDK projects!

@Star Vitebsk
Is that your mobile phone number in your signature??? I wouldn't show mine to the public like that...

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 20th Mar 2011 14:52 Edited at: 21st Mar 2011 00:43
Update 2.2 is nearly done! Heres the current list of changes:

New functions:
BT MakeTerrainObject TerrainID,LODLevel,ObjectID - This will create an object for a terrain and make each sector as a separate limb. This is for simpler collision.
BT DisableTerrainNormals TerrainID - This will prevent BT from generating normals for a terrain. This will improve load speed and RAM useage and should be used when lighting is precalculated on the texture.
BT EnableAutoRender Enabled - This will make BT automatically draw everything in the sync command without the user needing to use any update/render commands. This is easier but may be slower.
BT UpdateObjects - When you have positioned, scaled or modified your terrain, this function will apply those changes to the collision objects generated with BT MakeSectorObject or BT MakeTerrainObject.
BT SetAreaHeight TerrainID,X1,Y1,X2,Y2,Height - This sets the height of all the points in an area.

New features:
Ability to set the amount of Smoothing or Reduction to be done on a terrain.
Add Painting functions to Realtime Terrain modification.
Collision objects update when terrain is modified.
Add round flag to GetGroundHeight which makes it get the height of the nearest vertex.

Bug fixes:
Fix holes which sometimes appear when using Reduction.
Fix pinholes which sometimes appear when using Reduction. (different to above)
Fix GetGroundHeight when using Reduction.
Fix normals bug reported by smass. (not been reproduced yet)
Fix normals bug reported by KISTech.
Fix bug which causes huge terrains to not be able to modify the entire terrain.
Fix crash when terrain with lots of exclusion is modified.
Fix BT FlattenTerrain making holes instead of flattening.
Fix crash when deleting terrains.
Fix extra quads being created on far edges.
Fix discolouring on edge pixels of the terrain caused by UVs being wrapped. (UVs are now clamped)


I will get to work on the GDK version as soon as the update is out.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 20th Mar 2011 14:56
Heres some more information about the Painting commands:

BT PaintTerrain TerrainID,X,Z,Radius,Colour

This sets the colour of all the points in the circle to the colour.


BT PaintTerrain TerrainID,X,Z,Radius,MinColour,MaxColour

This does the same as the above but sets the colour to a random colour in the range. For example, set MinColour to a light shade of green and MaxColour to a dark shade of green and this function will set the colours of all the points to different colours within this range to add some realism.


BT SetPointColour TerrainID,X,Z,Colour

This sets the colour of a point.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 20th Mar 2011 16:37
Hi Kaedroho, I may have a project coming up which needs terrains.

What are the current options for light-mapping the terrain, is there anyway to use it with Dark Lights? If not, are there any other options without writing a tool/shader myself?

Thanks.

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 20th Mar 2011 16:52
You can lightmap terrains by adding the light to the texture. You can put your heightmap into L3DT and that will produce a lightmap and then you load both your lightmap and texture and mix them together using memblock images (there are a few libraries around to do this as well) then apply this final texture as your terrains texture.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 20th Mar 2011 17:58 Edited at: 20th Mar 2011 18:00
Thanks for the information on the process that is required.

I presume L3DT can't help me lightmap my terrain once I put down trees and buildings? I also need to generate lightmaps on the fly as my maps will be created in an editor.

Since I will probably only need one directional light I might consider making a tool to do this for me which takes into account all objects in my scene.

I presume I just raycast a line at a given angle to each point on the terrain depending on the resolution of the texture image and create my image using the result of whether the rays hit the terrain or not?

Has no one ever made such a tool/plugin to do this on a terrain? It seems it should be simpler than a full light-mapping tool of which I know of two, Dark Lights and some code Evolved posted a while ago.

Would this possible tool be of any interest to anyone?

Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 20th Mar 2011 19:52
Just reposting incase you missed,

Quote: "
Have you thought about using Blendmapping to allow multiple textures for blitzterrain? I believe DX9 supports upto 8 unique textures for an object and this would be great because it would provide a route to multitextures without the need of shaders
"



Making dreams possible, one line at a time...
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 20th Mar 2011 21:10
@ Kaedroho,

These additions are bang on!

Some possible ideas for the future...

Quote: "BT PaintTerrain TerrainID,X,Z,Radius,MinColour,MaxColour

This does the same as the above but sets the colour to a random colour in the range. For example, set MinColour to a light shade of green and MaxColour to a dark shade of green and this function will set the colours of all the points to different colours within this range to add some realism."


an idea would be to optionally allow colours to grade between min and max depending on how proximate they are to x/z - maybe optionally with some randomness then thrown in?

Quote: "BT SetAreaHeight TerrainID,X1,Y1,X2,Y2,Height - This sets the height of all the points in an area."


an idea would be to optionally allow for a specified element of randomness or variation in the flattened area of land?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 20th Mar 2011 21:28
Just did a quick test to create a lightmap on a texture and it turned out to be quite easy(image attached).

This is using the 'intersect object' command and memblocks to alter the image.



If I create a tool for this I will share with all

Attachments

Login to view attachments
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 21st Mar 2011 00:48 Edited at: 21st Mar 2011 00:49
Oneka,

Yep, It will be multidetailmapping to allow the base texture to set the base colour. This allows you to add different shades of grass and even shadowing which prevents your terrain looking tiled.


Duffer,

Both great ideas. I will add those to the list.


matty halewood,

Great work! You could try doing the same thing on the terrain object so mountains cast shadows.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 21st Mar 2011 02:47
@kaedroho

So are you saying we will have different shades of the same texture? Because what I was talking about allows you to have multiple separate textures instead of just one texture and it varying in colors.

One way you could implement would be through texture-splatting http://www.gamedev.net/page/resources/_//183/403/texture-splatting-in-direct3d-r2238


Making dreams possible, one line at a time...
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 21st Mar 2011 18:46
how to get the coordinates of the collision, for example when a shot?
number or sector?

VitebskStar@tut.by
icq: 157980031
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 21st Mar 2011 21:00 Edited at: 21st Mar 2011 21:03
I've got a question, is there any way to change the texture of the terrain in real-time? would it be possible to have bt setterraintexture change the texture instantly, without having to compile.

[EDIT] That actually works, once again I posted before thinking.

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 22nd Mar 2011 01:27
@ Kaedroho,

In my rush for greatness, I forgot an obvious command:-

BT Get TerrainColour TerrainID,X,Z ?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 22nd Mar 2011 11:07
Oneka, Thanks for the link


Star Vitebsk, you'll need to use a collision plugin like sparkys.

Firstly you create some DBPro objects for your terrain. Use BT MakeSectorObject to do this. Version 2.2 has a new command which can create all the objects with 1 command and stick them into the same object as different limbs.

Then you need to use sc_setupcomplexobject on each of the objects.

Then you just use sc_raycast to cast a ray from the player to where the player is pointing and this will return a position and object id of the point which the player is pointing at.


thenerd,

Yep BT SetTerrainTexture will change the texture very fast. You can acctually call this every loop without losing any FPS.


Duffer,

Good idea! I will add that to the list.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 24th Mar 2011 11:35 Edited at: 24th Mar 2011 11:35
The terrain colouring commands are all working now. I had to add a new function called "BT UpdateTerrainTexture TerrainID". This should be called after editing the terrain texture and before the sync command. It basically copies all the changes to the texture to its lower mip map levels. This doesnt have to be called when mip mapping is not used.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 24th Mar 2011 23:01
I have just sent off BlitzTerrain 2.02 to TGC. They will have it on the website shortly.

Heres a list of changes:

Added function BT MakeTerrainObject TerrainID,LODLevel,ObjectID.
Added function BT EnableAutoRender Enabled.
Added function BT UpdateObjects.
Added Ability to set the amount of Smoothing or Reduction to be done on a terrain.
Added Painting functions to Realtime Terrain modification. (4 new functions)
Collision objects now update when terrain is modified.
Added round flag to GetGroundHeight which makes it get the height of the nearest vertex.
Fixed GetGroundHeight when using Reduction.
Fixed normals facing the wrong way.
Fixed huge terrains to not be able to modify the entire terrain.
Fixed crash when terrain with lots of exclusion is modified.
Fixed BT FlattenTerrain making holes instead of flattening.
Fixed crash when deleting terrains.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 25th Mar 2011 00:18 Edited at: 26th Mar 2011 11:32
excellent! a top plugin further developed!

Howz about a function to get the colour of the terrain at a certain point? :-

BT GetPointColour TerrainID,X,Z()

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 28th Mar 2011 08:14 Edited at: 28th Mar 2011 08:24
Quote: "Yes thats easy. Open the basic3d dll in your plugins directory with notepad and search it for getobjectsize If that doesnt return anything, then look for getsize (they sometimes done have the word "object" in them). It should find a string which looks like this (I done getobjectsize for you): ?GetSize@@YAKH@Z

You use the windows functions GetModuleHandle and GetProcAddress to get the pointer to the function. You can then call that function from its pointer."


No, I already know all that, but it just returns an infinitely small number when I try it. That's my problem. ?GetSize@@YAKH@Z, when I call it (after doing proc thingys and everything) just returns an infinitely small number. I know I'm doing it right because position and rotation and many others work perfectly.

Help?

EDIT: How soon before 2.02 is on the blitzwerk website?

Clonkex

Never lie -- The government doesn't like the competition.

Intel Core 2 Duo 2.8Ghz, Nvidia GeForce 9400 GT 512mb, 1gb ram.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 28th Mar 2011 18:14 Edited at: 28th Mar 2011 18:15
Good idea Duffer, I will add that to the todo list for 2.03.


Clonkex, Have you got the return value of GetSize set to unsigned long in your code? DBPro commands which return floats acctually return them as dwords. You can convert these dwords to floats using:


I will have the free update on the blitzwerks website once the update for the full version is up.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 28th Mar 2011 18:33
Version 2.02 is now up on the TGC website!

Free version will be up later today.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Mar 2011 19:20 Edited at: 28th Mar 2011 19:21
Good work kaedroho,

But stop spoiling the dbPro users and give us GDK users some attention

Just kidding, I'm not starting my terrain project for a couple of months yet.

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 28th Mar 2011 20:39
Yep, I've said that the next thing i'll do is get the GDK version out. Hopefully, should have it done this month.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 28th Mar 2011 21:42
Quote: "the next thing i'll do is get the GDK version out."


A thousand thumbs up! Can't wait to finally get my hands on it!
Especially since you're constantly packing great features in.

Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 29th Mar 2011 00:01
Quote: "Yep, I've said that the next thing i'll do is get the GDK version out. Hopefully, should have it done this month."

I am definitely anticipating the release of the GDK version too, I will purchase it ASAP


Making dreams possible, one line at a time...
Travis Gatlin
14
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 29th Mar 2011 00:17
@kaedroho
I am having some trouble with the free version of Blitz Terrain,
I am using DBP version 1.077 beta (according to DBP), My OS is Vista, even though all the files are in the right place, the app compiles without issue, but once the window appears for the game, my computer says "My Project Has stopped working" and the game exits, any idea what could be causing this issue?
The code i was using is the Terrain Generation example file that came with Blitz Terrain when i downloaded it.

My Current Project: Unbenounced to you, Puny Human!
Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 30th Mar 2011 07:40
Quote: "Clonkex, Have you got the return value of GetSize set to unsigned long in your code? DBPro commands which return floats acctually return them as dwords. You can convert these dwords to floats using: "


Yes, I think I already did that. Actually I found it seems to work if you don't put the convert-float-to-dword thingy. But it doesn't help cause I need to use it with physics engines and I don't know what it's problem is.

How soon before 2.02 is available on blitzwerks.co.uk?

Clonkex

Never lie -- The government doesn't like the competition.

Intel Core 2 Duo 2.8Ghz, Nvidia GeForce 9400 GT 512mb, 1gb ram.
peterJBE
16
Years of Service
User Offline
Joined: 11th Mar 2008
Location: Belgium
Posted: 30th Mar 2011 13:49
@travis gatlin
I have experienced comparable problems.
I could solve them running the resulting *.exe in
XP compatibility mode.

My system Windows 7, 64 bit, (Norton antivirus).
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 31st Mar 2011 13:46
BlitzTerrain 2.02 R1 free is now available!

Download:
ZIP
RAR

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 31st Mar 2011 13:48
travis gatlin and peterJBE,

I will test it on a 64 bit Windows 7 PC later today and hopefully find the problem.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
pdq
17
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 1st Apr 2011 06:00
I have the purchased version of BlitzTerrain. How do you import a RAW or 16bit heightfield map? What file format does the 16bit map have to be in? I cannot seem to fing any instructions on doing this.

Thanks.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 1st Apr 2011 16:42 Edited at: 1st Apr 2011 16:47
Firstly, you have to convert your RAW file into a colour heightmap.

Heres some code I wrote to do this:



I have attached an example of what the heightmap should look like.

You then simply load the heightmap in like normal and Blitzwerks Terrain will detect that its a colour heightmap automatically.

I would recomend that you convert this file into a png file. This is because png will chop off the blue channel which is not used but bmp won't, saving disk space.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.

Attachments

Login to view attachments
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 1st Apr 2011 19:31
Quote: "png will chop off the blue channel"
I did not know that, but that raises the question; Why not save as a PNG from DBPro in the first place?
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 1st Apr 2011 20:10 Edited at: 1st Apr 2011 20:12
DBPro can only export to bmp. There might be a plugin around which can export to png.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 1st Apr 2011 20:16 Edited at: 1st Apr 2011 20:17
DBP can export to .png - I've managed it before.

You just have to use:

and save it with the .png file extension.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 6th Apr 2011 23:06
Hi Kaedroho, I know this is the wrong place to ask but could you update your "Draw Object" plugin? I am having problems with getting objects to render to additional cameras and I am hoping that will help. In your original thread you said that objects are rendered to the "current camera" but no matter what I do, the objects are being rendered to camera 0.
Travis Gatlin
14
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 8th Apr 2011 05:27 Edited at: 8th Apr 2011 05:35
I'll Try XP Compatability mode, thanks for the advice! hopefully it'll work.

UPDATE
Nope, no dice, apparently i'll have to wait for him to debug it.

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 10th Apr 2011 20:01
It works fine on my Windows 7 x64 laptop. I don't know whats wrong. Could you find which function is crashing?

revenant chaos, Yep, I'll do that once I've solved these bugs in BT first.



The GDK version is up and running again. Just got to rewrite the demos (BT has changed so much since the last GDK release). Once thats done I'll release a beta of the free version. Should have it all tested and ready by the end of the month.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 10th Apr 2011 20:54
Woot woot, I am pretty much waiting on the GDK version so I can tie it in with my engine


Making dreams possible, one line at a time...
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 10th Apr 2011 21:44 Edited at: 10th Apr 2011 21:45
GDK Version is out!

Users of the old GDK version may find that their code will break after updating.

Download
ZIP
RAR

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.

Login to post a reply

Server time is: 2024-03-29 08:57:50
Your offset time is: 2024-03-29 08:57:50