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
Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 12th May 2010 13:29
Did you see the "stress-test" forum member smaas has given Blitzterrain in a related thread on this Board? He has set in into a very sophisticated sky system, among other things. The source code from his site is very instructive and serves as a good example of using the Blitzterrain commands in a very comprehensive demo.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 12th May 2010 16:35
Quote: "Are you using the DBP objects for collision, visuals or both?"

The DBP objects are excluded (EXCLUDE OBJECT ON).

Quote: "Did you see the "stress-test" forum member smaas has given Blitzterrain in a related thread on this Board? He has set in into a very sophisticated sky system, among other things. The source code from his site is very instructive and serves as a good example of using the Blitzterrain commands in a very comprehensive demo. "

I saw that, pretty amazing .

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 16th May 2010 13:29 Edited at: 16th May 2010 13:34
@ Kaedroho,

Have now played with the new demos and downloads - fantastic...

Looking at version 2, beta2, are there any commands not in the beta that are in v1.6? Cant find any, just wanted to check...

Fairly sure you were only going to put RTTMS commands in the Pro version (rather than Basic or Standard)? Or was it the basic set point height in Standard, but the more brush like RTTMS commands / point painting commands in Pro?

What are you planning on doing next with this invaluable project?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 16th May 2010 21:25
Hey in the mean time while you are trying to fix the GDK version could you post the last working version of BlitzTerrain for the GDK one so I can use it to prototype some things in my game?


Making dreams possible, one line at a time...
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 16th May 2010 22:34
I just wouldnt mind a post when you're ready re what commands and features you're going to work on next...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th May 2010 01:13 Edited at: 17th May 2010 01:14
Hey, sorry for not posting earlier.

The final release binary is nearly ready! I'm still having problems with DarkGDK. Some GDK commands are returning strange values and its crashing the system. DBPro version is working just fine though.


Some changes are:

Added far plane so frustum culling culls things which are far away.

Better RAM useage. (converted alot of longs to shorts and chars)

Internal Scaling is now Fully internal. BlitzTerrain uses a fixed scale of 100 internally. All commands which need position get scaled. This solves crash bugs when using numbers with a decimal point (some calculations inside BT get inaccurate when decimal points are used). The DBPro scale of the terrain is now always 100,100,100 by default and not some other number used to cancel out the scaling done by BT.


And one more feature to add:

New system for reading and writing BlitzTerrain internal data. This will be used in collision and physics engines. It will also be used for anyone who wants to create their own brushes or terrain modifiers by accessing the vertexdata directly.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th May 2010 01:42
@Kaedroho looks cool, I started using an old version that was on your website blitzterrain106b1 was the file name, and I dont know how the feature versions work, but I noticed that my terrain does not seem to work with the lighting features, such as ambient light or related


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th May 2010 02:14
Use BlitzTerrain 2.00 Beta 2. Its on the first post of this thread.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th May 2010 02:21
Well thats the problem, I am using GDK, so thats why I originally couldnt use it


Making dreams possible, one line at a time...
Zipir
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location: Turkey
Posted: 17th May 2010 02:51
kaedroho---Will support blitz terrain (when its done) detailed terrain textures like (Extended Terrain) ???
Zipir
15
Years of Service
User Offline
Joined: 11th Aug 2009
Location: Turkey
Posted: 17th May 2010 02:52
im waiting for buy it
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th May 2010 05:25
I am still playing around with the old version since the new one will not work,

I do have a few suggestions for the new version if they are not implemented

-Be able to treat the terrain object as a single object in DBPro / GDK because when I tried to position the terrain, I found that I positioned a section of the terrain and not the whole terrain, so commands that would make it easier to manipulate the whole terrain at once and pieces would be great, such as BTPositionTerrain(id,x,y,z) etc

-Make it so that I can build the whole terrain in 1 command instead of making a loop, I think you already implemented this past the version I am using, I am not sure but if it isnt, would be great to have

And if you are having problems with the GDK version is it because you updated to 7.4? Ive had problems with that version too so I am still on 7.3


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th May 2010 14:47 Edited at: 17th May 2010 14:51
Quote: "-Be able to treat the terrain object as a single object in DBPro / GDK because when I tried to position the terrain, I found that I positioned a section of the terrain and not the whole terrain, so commands that would make it easier to manipulate the whole terrain at once and pieces would be great, such as BTPositionTerrain(id,x,y,z) etc"


You can use position object to position terrains. Use the objectid you set in the build terrain function.

Quote: "-Make it so that I can build the whole terrain in 1 command instead of making a loop, I think you already implemented this past the version I am using, I am not sure but if it isnt, would be great to have"


Use BT BuildTerrain TerrainID,ObjectID,1
The 1 on the end makes it build the terrain without a loop.


BlitzTerrain must use 7.4 or above. This is because Lee just added a new system in to allow BlitzTerrain to render the terrain before DBPro objects. (solves transparancy issues).


Quote: "kaedroho---Will support blitz terrain (when its done) detailed terrain textures like (Extended Terrain) ??? "


I'm not sure what you mean. But BlitzTerrain does support detailmapping which makes your terrain look really high detail.

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th May 2010 16:08
Hope DarkGDK starts being a little nicer to you kaedroho.
Its like you've made a lovely cake and us DarkGDK people have to sit around and watch while all the dbPro people tuck in

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th May 2010 19:43 Edited at: 17th May 2010 19:44
Yeah I dont think the version I am using supports it because this is in the version I am using




I am using this version because this is the only working version of it that I can use currently because Beta2 has the malloc errors etc that I mentioned previously


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th May 2010 20:52 Edited at: 17th May 2010 20:55
I don't reccomend using 1.06 beta. It was just a test to show that BlitzTerrain will work with GDK. It was made in the very early stages of development and has very little optimisation and features.

To show you how much smaller it is. BlitzTerrain 1.06 is about 500 lines and BlitzTerrain 2.00 Beta 3 is just over 10000 lines.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th May 2010 20:53
Yeah, I guess I will have to just wait till the GDK one is fixed


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th May 2010 20:56
I think the problem is at your end since your the only person who is getting these errors. What compiler are you using? Are you compiling the demos as they are in the download?

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 17th May 2010 21:25
@ Kaedroho,

Thanks for the update last night.

Particularly interested in "It will also be used for anyone who wants to create their own brushes or terrain modifiers by accessing the vertexdata directly.". Will you nevertheless be doing brush/rttms commands in Standard and Pro versions?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 17th May 2010 21:40 Edited at: 17th May 2010 21:42
I am compiling them as the code is untouched with the direct download of Beta 2, and my errors are this



I am using 7.4 with the fixed libs
Visual C++ 2008 Express Edition
and using the BlitzTerrain200GDKBeta2.zip

EDIT:

I can compile the first demo
but all other demos and even in my game has the error with the EnvironmentMapping.obj, and the last demo, terrain loading does not work, it will freeze up, your last demo did work though that showcased the same code but it wasnt Beta 2


Making dreams possible, one line at a time...
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th May 2010 21:48
I am doing exactly the same as Oneka, with the fixed 7.4 Libs etc
Same results.




I too can compile the first project but don't see anything, the second one gives me above errors.

I know haliop says he can't run it either.

Kryogenik
15
Years of Service
User Offline
Joined: 22nd Sep 2009
Location: Heidelberg, Germany
Posted: 17th May 2010 22:54
I tried the demo, it's crazy good, and the code looks really easy! I got 150+ fps on my craptop. Is there anyway to convert 3d models into heightmaps? Because I want to model my terrains and then use this for LOD and better texture detail. I'm sure there is some way to use the vertex data commands to do this, but I haven't used them yet. Thanks in advance

Codesurge is so awesome, thanks Hyrichter.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 18th May 2010 00:31 Edited at: 18th May 2010 00:32
Duffer,

The new system will allow dll developers and gdk users to lock vertexdata, edit it and update it. In the free version, the vertexdata will not update into the buffers. So you can only read vertexdata and not write it.



Oneka and matty halewood,

You are using old blitzterrain headers. Either update them or change the following lines:

BT_SetTerrainLOD(unsigned long,char)
BT_SetTerrainLODDistance(unsigned long,unsigned long,float)

to:

BT_SetTerrainLOD(unsigned long,unsigned char)
BT_SetTerrainLODDistance(unsigned long,unsigned char,float)


If you know that both your headers and libraries are up to date then let me know and I'll look into it.


Quote: "Is there anyway to convert 3d models into heightmaps?"


Not in BlitzTerrain but it is possible to develop an app for this. BlitzTerrain is for generating and rendering terrains, not the other way round.

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 18th May 2010 00:37
@ Kaedroho,

Sounds like I'm better off out of that then - definitely not a dll developer!

Just to allay my fears... you are going to put in RTTMS/Brush stuff in Standard (a little) and Pro (a lot) versions?

Could you set out in draft what you envisage (in terms of commands and functionality) being in the Standard and Pro versions, as opposed to the Basic version (which I assume is the perfected version of what you have produced so far?)

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 18th May 2010 03:56
Quote: " tried the demo, it's crazy good, and the code looks really easy! I got 150+ fps on my craptop. Is there anyway to convert 3d models into heightmaps? Because I want to model my terrains and then use this for LOD and better texture detail. I'm sure there is some way to use the vertex data commands to do this, but I haven't used them yet. Thanks in advance"

You got it. You can make a DBP program to convert the model to a heightmap.

I suggest creating a bitmap with width and height equal to the number of vertex rows and columns on the model. Go through the vertices with a for c=1 to get vertexdata vertex count, ink a greyscale color based on get vertexdata y(c), draw a dot on the bitmap based on the x and z. Once you're done, save the bitmap.

I can give an example later but not now, stupid physics test .

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 18th May 2010 05:29 Edited at: 18th May 2010 07:21
@Kaedroho, I did what you said and all the demos compile now, BUT I have warnings now





And with the demo code untouched the terrains work but have no texture OR detail (texture.jpg,detail.tga) but the exclusion map DOES work fine, but it does not seem to like making detail or textures appear, I have noticed that it does change the color of the terrain, but its just from solid white to w/e is the majority color in said texture, so in the demo the terrain turns a fleshy peach color

ALSO

In the GDK file that you have for download DO NOT have the updated header files, even the ones I freshly downloaded still have the incorrect LOD and LODDistance parameters

EDIT: I also noticed that the terrains when created appear reversed when made in game from a heightmap

Is there anyway other than changing the heightmap to fix this? like maybe a bool value to tell the Blitzterrain how to read and render the terrain

Original Image Corners
AB
CD

Blitzterrain Creation Corners
CD
AB

IMAGE



The problem I had with this was when I went to line all my terrains up, they didn't match up and I noticed that its more than likely the way its reading the heightmap


And sorry if I am being annoying lol, but yeah, I love Blitzterrain its everything I hoped for in a terrain system, just having some issues


Making dreams possible, one line at a time...

Attachments

Login to view attachments
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 18th May 2010 13:11 Edited at: 18th May 2010 13:14
Quote: "Is there anyway other than changing the heightmap to fix this? like maybe a bool value to tell the Blitzterrain how to read and render the terrain"


Use the command BT SetATMode. This makes BlitzTerrain load heightmaps the same way Advanced Terrain does. The reason why it is flipped is to make it easier for editors. Basically, I wanted to make pixel 0,0 be the height of the vertex at 0,0. Advanced Terrain flips the heightmap around to make it easier to see your terrain as it is on the heightmap.



With the convert object to heightmap thing, It might be easier to colour each vertex depending on its height so all the vertices at the top of the object will be white and all the vertices at the bottom will be black. Then make an orthographic camera and take a top down picture of the object. Then you have a heightmap. This method will work for all types of terrain, different LODs and even ones which have different amount of detail in different areas.

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th May 2010 18:29
Changing the headers got it to run with these warnings:


Something is not quite right for me also:



Also it seems that at some point you put the media into the 'bin' folder but never updated the examples code, just a small issue but thought I would let you know.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 18th May 2010 18:46
Yeah I had the same issue with textures and detail maps not working on the terrains but it does read heightmap and exclusion maps fine, I also noticed that when you move the terrains using GDK position object commands, the terrains new position isn't taken into account when you use commands like BT_GetGroundHeight


Making dreams possible, one line at a time...
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 19th May 2010 04:09 Edited at: 19th May 2010 04:16
Ok, I have ANOTHER post of something that I came across,

I am having a problem with making seamless terrains from an image that was just cut-up (so it should be seamless tbh)

but I noticed this problem when I was working with it

EXAMPLE:
Heightmap Dimensions 256x256
Terrain Scale 64
So 256x64 = 16384

-BT_GetTerrainSize = 16384
-Terrain visually is 16384 units big BUT
-BT_GetGroundHeight DOES NOT read tile number 256 for it's height
so by BT_GetGroundHeight standards the terrain has height values from 0 to 16320
-Which is 0-255, 255*64 = 16320
-So basically any tiles within x=255->256 z=? or x=? z=255->256 will not have a height value, EVEN though they visually are raised on the terrain

This probably is also the reason why my hieghtmaps are not lining up correctly even though the BMPs are of originally the same image just split up into 9 smaller images (768x768 map cut up into 9 256x256 maps)

EDIT: I am guessing that its the way the Blitzterrain will read your images, it reads it from 0-255 which is 256 units and not 0-256 which would be 257 units but would in theory fix said problem?

Ive tested this in my game engine and basically when my character moves past 16320 Y#=0, so thats telling me that anything past 16320 is not being taken account for, even though I get returned a size of 16384, so I am missing about 64units on the scale from the data OR 1 pixel from the map

So I am thinking that its reading tiles like this

0-1 1-2 2-3 .... 254-255 [0-255]
and not
0-1 1-2 2-3 .... 254-255 255-256 [0-256]


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 19th May 2010 15:34
Tile number 256 doesnt exist. When you have an image of size 256x256, that means it has 256 pixels accross and down. BlitzTerrain numbers its tiles from 0 - 255 which is 256 different points.

If you read it 0 - 256 there will be 257 different points and there isnt that many on the heightmap. Some terrain engines support heightmaps which have widths of 129, 257, 513, etc and its on my to do list.

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th May 2010 16:06
Quote: "Yeah I had the same issue with textures and detail maps not working on the terrains but it does read heightmap and exclusion maps fine"


@Oneka - Have you got this to work now as it seems from your later posts that you are using it?
If so, what did you have to do?

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 19th May 2010 19:27 Edited at: 19th May 2010 19:28
No, the texture and detail maps are still not working

@Kaedroho, then how come the terrain reports a size of 16384 but only has data upto 16320 for height?

I have the source AND a compiled version together to prove my point of the bug THAT is present for me atleast
BUG:
-Terrain has no height data for X=0 to 1st_Tile,Z=0 to 1st_Tile and X=MaxTiles-1 to MaxTile, Z=Maxtile-1 to MaxTile EVEN THOUGH visual height is apparent, there is NO Terrain->GetGroundHeight data

CODE:
This is taken from 03SmoothingandQuadRotation
-Only added code to keep Camera within boundary of 0 and Terrain size
-Added Code to display Text on screen of it visually not outputting hieght data



EXE Included ALSO showcases the texture and detail maps NOT working. just creates a yellowish terrain


Making dreams possible, one line at a time...

Attachments

Login to view attachments
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 19th May 2010 20:08 Edited at: 19th May 2010 20:12
Oneka. Again, this is not a bug. This is a bug with your code.

Just look at your code. The movement is done in this order.

Move
Get Ground Height
Limit the position

When you are trying to go to the edge of the terrain, you would be moving slightly outwards. So lets say you are on the edge of the terrain and moving outwards. When you move outwards, your camera comes off the terrain. You get the ground height while the camera is still off the terrain so there is no data. You then limit the position before rendering anything which makes it look like you are right on the edge.

Try stopping on an edge, does the camera immediately go to the correct height?

Stopping on the edge will make it get the ground height while at 0 and not slightly off the edge of the terrain so it should work.


To correct this bug, get the height AFTER you have limited it.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 19th May 2010 20:44 Edited at: 19th May 2010 20:50
@Kaedroho

I know that the order isnt right, but it still should read values for that area, because the code will output the height for all other values, even with your original code unmodified I still get the same problem, its not the way I did it, Is just not giving me values for that position I do a more Direct Code to show you

This version outputs the data that I am talking about
Basically its going to output the last 64 units within range
I modified the Hieghtmap to be one solid color of 255,255,255 so no tile should be 0 in height it is in the included files



EDIT: And we still have yet to hear word on the TEXTURE or DETAIL map problem, any ideas Kaedroho?


Making dreams possible, one line at a time...

Attachments

Login to view attachments
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th May 2010 20:49
@kaedroho - About the textures, do you acknowledge that there is an issue with the GDK version, or do you think it may be something we are doing, or our setup?

Anyway, I think you are working on the next version and I know how much of a pain it is to go back to look for issues in other versions so I'm more than happy to wait, no matter how long it takes, good luck and thanks for making this free for everyone.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 20th May 2010 20:36 Edited at: 20th May 2010 20:38
Ive been playing around with it more

And I have a picture attached that even showcases the problem I have been talking about
-Using latest Version of DirectX Feb2010
-Using latest Version of Blitzterrain that is available on website Version 2 Beta 2
-Using GDK 7.4 with correct Core & Display Libs
-Using Latest Version of DBPro / Codesurge IDE
-Using Visual C++ 2008 Express
-Windows XP Home Edition SP3
-Not Imagining the issue :/

GDK Version
-Texture and Detail Maps NOT working with unmodified code
-Black Line Appears along bottom and left edges of the terrain
-Area where Black Line appears on Bottom and Left Edges AND Top and Right Edge where line does not appear the terrain has VISUAL height data, but no GetGroundHeight data, it will return 0, this is for all terrains created, which is weird since visually you can see that the vertexes were created and APPEAR to be raised, maybe I am just crazy
-05TerrainLoading When Ran LOCKS up, does not work
-When Positioning a terrain from original location ie 0,0,0 using GetGroundHeight does not take new position into account (This probably isnt a bug just noticed that)


DBPro Version
-Texture and Detail maps ARE working
-Same Issue as above with Black line
-Same Issue as above with no hieght data for edge


Image that is included:
Shows the two version side by side running and the issue that is plaguing me, The bottom two shows Black lines + the ability to go through vertexes on the edge due to no height data, EVEN though I am still within the size range reported by GetTerrainSize()



yarp


Making dreams possible, one line at a time...

Attachments

Login to view attachments
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 21st May 2010 18:36 Edited at: 21st May 2010 18:37
kaedroho - I tracked down that funny problem I was having. It appears the problem is SPRITES. Creating any sprites in DB completely screws up BT's rendering order.

Easily enough worked around, but definitely should be addressed.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 25th May 2010 14:47 Edited at: 25th May 2010 14:58
BMacZero, Thanks! I'll look in the DBPro code to see if there is any conflicts.

Sorry about recent lack of updates, I have been doing exams recently so my programming time has been taken over by revision.



Anyway, heres some download counts I just got off my website.

BlitzTerrain DBPro: 340 Downloads
BlitzTerrain GDK: 78 Downloads

As you can see, DBPro version is ALOT more popular than the GDK version. This is probably because version 1 was DBPro only so there are more people from the DBPro community watching this thread.

These are the download counts taken from 4 weeks of data collection between 2nd of May and 23rd of May. There have been alot more ZIP downloads than RAR downloads.



Heres a list of bugs I hope to get sorted by the final release.

Terrain which doesnt exist being created at the far edges of the terrain (Okeka reports this in the screenshots above). I will add 2 ways on solving this. 1) delete the tiles. 2) add support for heightmap sizes like 129, 257, 513, etc so there is data to give to those tiles.

Black line on the far edges of the terrain. This is caused by the terrain that doesnt exist and making the Normals flip upside down. (Because the height of the tiles behind are acctually zero).

Solve conflict with sprites dll.

Texture problems in GDK version. (Unable to reproduce)


And one feature:

Add new system to allow third party dlls and GDK users to view and edit terrain vertex data. This feature will become available to DBPro users when I have finnished my new vertexdata commands dll.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 25th May 2010 15:09
Sounds good, any ideas as to why the texture problem exists though?


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 25th May 2010 15:14
Its probably a rendering engine issue. BlitzTerrain acctually applies textures using DBPro (this makes it easy for users to change textures). And when it renders the terrain it just simply copies the textures from DBPro into DirectX.

This also reminds me that I should also finnish off render states aswell.

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 25th May 2010 15:20
I see, because just the detail maps and textures don't work, but everything else is fine from what Ive used so far


Making dreams possible, one line at a time...
smaas
16
Years of Service
User Offline
Joined: 29th Oct 2008
Location: Edam, Netherlands
Posted: 26th May 2010 14:02
I've noticed an other problem. BT GetGroundHeight does not always returns the right height. This especially on small ridges/dykes. I use BT GetGroundHeight to position grass on top of it and you can see the result on the picture



you can download the demo together with the heightmap here


http://www.edam1740.nl/landgen/GetGroundHeight.html
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 26th May 2010 21:26
Just ran your demo and saw the problem. I also spotted a frustum culling problem. Did you get that too?

Can you provide the code to that demo so I can try recompiling it with new versions of BlitzTerrain so I can fix it?

Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 26th May 2010 21:41
@Kaedroho,

Do you have any suggestions for making seamless terrains when using multiple height maps?

For example, In my game world I represent areas in 3x3 grid format and I am going to implement a system that automatically loads and unloads grids when you move across them, but the trouble I have had so far is I have taken a larger image and split it into smaller sections and when I lined them up, the edges do not line up perfectly, they have very noticeable differences but they are close enough for me to know that they are correctly lined up


Making dreams possible, one line at a time...
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 26th May 2010 21:57 Edited at: 26th May 2010 22:03
I have partially fixed the terrain size bug. The terrain size should now report to be a little lower where the terrain acctually is. I haven't excluded the extra tiles yet.

That will be possible when I add terrain streaming. I would reccomend to save your terrains in BlitzTerrain format as it is much faster to load.

The problem with doing it manually is that LOD wont update properly. This causes holes in the terrain where a low LOD and a high LOD sector meets. BlitzTerrain will have the ability to load and change parts of the same terrain in realtime so LOD can update properly.

Edit: Black line around the far edges is now also fixed.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 26th May 2010 22:10 Edited at: 26th May 2010 22:22
I might introduce a new command.

BT SetTerrainNormalsDepth TerrainID,depth

What this does is it changes the depth of the normals, ie. Set this to 0 and it will be like having no normals, every normal will face upwards. Set this to 100 and the normals will only face in the direction of the face it is on and will not face upwards. Set this to 50 and it will point the normals in the direction of the face.

By default in all terrain engines the depth is 50. Normals face in the direction of the slope they are on. But I have found that terrains look better when the depth is about 75. It makes the shadows darker without effecting the colour of everything else much. It also adds more shadows. And the terrain looks alot nicer.

Take a look at the attached screenshot. The left side is normal depth set to 50. The right side it is about 75.

Attachments

Login to view attachments
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 26th May 2010 22:35 Edited at: 26th May 2010 22:38
Sounds good,

Quote: "I have partially fixed the terrain size bug. The terrain size should now report to be a little lower where the terrain acctually is. I haven't excluded the extra tiles yet."


My opinion for this is to keep it so that when you create a terrain the scale is accurately taken into account ie, 128x128 with a XZ scale of 64 means that its units are 8192x8192 and just increase the array size instead of 128 [0-127] to 129 [0-128] to take that extra block into account because if you just cut that data out, then a 128x128 with a 64 scale would be 8128x8128 units, because I am pretty sure it wouldn't take much more code since its already creating those tiles there with height levels based on the pixel darkness

EDIT:
I don't think with the seams lining up that it is a problem with the LOD levels because I have noticed this problem when standing on the edge of 1 terrain looking at the connecting lines with the LOD showing highest poly model, I will post a screen shot of what I am talking about next time I have a chance, I am at work atm


Making dreams possible, one line at a time...
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 27th May 2010 02:05
All I need to be happy is a BT SetGroundHeight(terrain, xpos#, zpos#) command.

For now anyway .

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 27th May 2010 03:03 Edited at: 27th May 2010 03:05
Do you want it to have a parameter saying what height to set it to aswell?

Like: BT SetGroundHeight(terrain, xpos#, zpos#, height#)




Login to post a reply

Server time is: 2024-11-23 20:34:26
Your offset time is: 2024-11-23 20:34:26