Importing DFX files from Terragen


(Rhysy 2) #1

I’m trying to use the seemingly easy and clever method pioneered by alltaken to import terragen terrains into Blender. Using For Export Only with terragen, I can export the terrain as a DFX. But when I try to open the DFX in Blender, one of 2 things happens (depending on which method of writing the DFX I use) :

  1. It thinks for a while, then the program is useable, but without an imported DFX to play with.
  2. I see the “working in background” symbol on my cursor, but no thinking light on the PC, and 10 minutes later, there’s still no sign it’ll ever stop pretending to be doing something.

I’ve tried using Crossroads to convert the DFX to a vrml, but it can’t handle it, I think because Crossroads only uses another version of DFX.

Can anyone help ?


(Dittohead) #2

okay not a good idea…

search for:

Terragen import script blender

at www.google.com


(Alltaken) #3

Dittohead it is a good idea so take it back :stuck_out_tongue: my method works totaly differently to ter2blend (which is good but renders in terragen)

thanks “rhysy 2” it makes me happy that someone else is using my method. (pm me if you need harder help)

ok how i do it as i think i first had trouble.

  1. export as “faces” individual polygons therefore 4-6 repitions of each vertex. (i will go and try the other method too of )

  2. then i import it and remove doubles in edit mode, on all the mesh parts. after that i join as many parts ~5 to make larger parts ~4 large parts.

it thinks for a while about it all as the dxf file for me was about 100Mb

-----------important read--------

thinking about it
symptom (couldn’t see anything but could do stuff after it finished thinking)

answer ----go to top view and zoom out a long way then select the mesh and shrink it down a lot.

alternative ---- reduce the export to 0.1 or less dxf units per terragen unit

should work ----- and ignor the first stuff i wrote these two ideas will have worked.

(if you want to use ter2blend note that the mesh is an inacurate size and the texture will not line up, also it is very poor detail as the mesh has been created at a very low poly count)

send me a pic when you have done and tell me how deailed it is i have yet to really explore my own techniques (just thought about how to do it for a while)

:smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: bye


(S68) #4

There is also a smart idea from Paradox in the Artwork forum (can’t recall if Work in Progess or Finished one)

Stefano


(Rhysy 2) #5

Grrr… this is now the third time I’ve tried to post this, my computer keeps killing my connection so I’ll be brief.

Paradox’s method - very clever, but too low detail in this instance.

Tried lowering to 0.1 dfx units - no effect. F.E.O either makes a 16mb file or 100 mb :
16 mb : Computer thinks, stops thinking, but hasn’t loaded the mesh (I checked with the browse datablock)
100 mb : Won’t load in about 10 minutes, none of the usual thinking noise (HD “buzz”, flickering light etc), just a working in background mouse cursor (usually means program has crashed).

Can anyone help ?


(Alltaken) #6

did you try saving the landscape as faces.

i will try doing without faces and see if it works right now.


(Alltaken) #7

i will tell you exactly what i have done.

FIRST TRY
pressed accessories
FEO autodesk DXF— faceted— 0.1 dxf units
loaded it into blender 2.23.
NOTHING HAPPENDjust as your symptoms show.
file size 4Mb

SECUND TRY
pressed accessories
FEO autodesk DXF— 3dfaces— 0.1 dxf units (takes longer to export and import takes ages)
loaded into blender2.23
works perfectlyjust needs a few vertexs (rem doubles)
file size 24Mb

it sohould work for you if you use the 3dfaces option


(LukeW) #8

Blender (and 3d studio max) take a long time to import big DXF files… even ones that are about 10 Mb…!
I’ve been importing terrain from Bryce lately… here’s some tips… try to import it with less than about 60,000 vertices and 120,000 faces… that way it can be a single mesh in Blender and you can use face smoothing seamlessly across the terrain. If you need to have more than one piece in Blender, there will be obvious boundaries between the smoothing… it also allows you to use SubSurf on the entire terrain rather than two pieces, also eliminating problems with the join.
BTW, when I imported the terrain from Bryce, none of the vertices were attached to each other. Blender automatically divided the terrain into several meshes even though there were only about 120,000 faces. To join the meshes I selected two of them, then I did ctrl-J then tab, then “A” to select all the vertices then “Rem Doubles”. If you can’t join the two meshes then you have too many vertices in your selection… so you can select half of the vertices in one of the meshes and press “P” to use those vertices to create a new mesh. Then you can now join the different meshes together since the pair has less vertices. Then you basically just join the rest of the meshes and weld vertices (rem doubles) until it fits onto one mesh.
Another tip: You can make a single-mesh terrain look very detailed by combing SubSurf with bump-mapping. “Nor” in the material properties increases the bump-mapping strength.
You can also fit more detail into a mesh by starting off with your say 512x512 mesh and “optimizing” it - reducing the number of polygons in a strategic way - so more polygons are allocated to curved parts of the mesh and less are allocated to flat parts of the mesh. 3D studio max lets you set the threshold angle in degrees - it is very good. Bryce isn’t good… it does “tessellating” which takes a long time and the finished mesh still looks pretty grid-like from above. Blender’s “Decimator” function acts uniformly across the mesh so flat and curved parts of the terrain have the same density of polygons…


(Rhysy 2) #9

Okay, alltaken, I followed your instructions precisely…
After an hour of waiting, there was no sign of anything happening so I gave up. I understand a 100mb file may take a while to load, but an hour ?!? That seems ridiculous. I don’t mind though, as long as once it’s saved as a blend file with that rem doubles thing it doesn’t take so long to load afterwards.

(as a matter of curiosity, what’s the rendering time like for the textured mesh ?)

Good tips LukeW, if only I could get the damnable DFX to load…
How do you know the number of vertices and faces you’re going to import ?


(sonix) #10

If Subsurf is slowing down render times too much, I use two opposing 45’ angled, wave animations on my landscape plane. Then use as many bump maps (Nor) as possible, with one COL texture.

I have managed to get really realistic jagged rocks this way.

I’ll leave yourselves to explore the wave settings for best results.

Sonix.


(Rhysy 2) #11

sonixsculpt : I have no problems with rendering time, because I have nothing to render, that’s the problem ! Thanks for the jagged rock tip though.


(LukeW) #12

sonixsculpt:
What do you mean by “wave animations”?

Rhysy 2:
I’ve got a Duron 1300 with 512 Mb RAM and it took maybe 10 to 30 or more minutes to load a DXF that was about 20 Mb. (I don’t want to try it again to get a more accurate figure)

I understand a 100mb file may take a while to load, but an hour ?!? That seems ridiculous. I don’t mind though, as long as once it’s saved as a blend file with that rem doubles thing it doesn’t take so long to load afterwards.

Depending on the speed of your computer it could take many hours… I suggest you export a smaller DXF (like 20-30 Mb, which is about 130,000 polygons, like I’ve suggested.

(as a matter of curiosity, what’s the rendering time like for the textured mesh ?)

Good tips LukeW, if only I could get the damnable DFX to load…
How do you know the number of vertices and faces you’re going to import ?

In the terrain generating program there is probably a setting for the resolution of the terrain grid - e.g. 1024 x 1024 or 512 x 512. If the grid resolution is 512 x 512 then that is 262,144 (512x512) squares which is 524,288 (x2) faces (triangles). In Bryce, the DXF exporter gives each triangle 3 new vertices, so for that example you x3 = 1,572,864. But if the faces share vertices then there would be much less vertices e.g. each corner of the faces could share with 6 others, so it has 1/6 of a vertex each, so each face (triangle) would have 1/2 vertex…

http://203.108.4.105/~wenke/blender/terrain-demo.jpg
I’m running lots of programs at the same time, such as the internet and Corel Photopaint. It takes 4.3 seconds to render it without OSA. You can see about a 1/3 of the landscape there. It uses two procedural textures - a colorband clouds one, and a stucci bump map one. If you look at the black part of the picture you can see how low-res the hill is. I want to use it in an animation so time is very important to me. It takes 6.3 seconds if I use the first level of SubSurf. Note that I used 3d studio max to optimize the triangles in this mesh… if you use an unoptimized terrain grid you wouldn’t get as much detail using the same amount of polygons (107,000 faces/triangles)

You can download that scene here: (1.7 Mb zip)
http://members.ozemail.com.au/~wenke/blender/terrain-demo.zip


(sonix) #13

Use Blender’s animation effects, funny bendy arrow icon on header. Add a new effect, select wave, then make X -100 Y -100 wave start -100 wave length 300, change other values to suit.

Then add another new effect in the same window, this will clone the first wave effect, and just change X +100 and Y +100.

Will post a pic to show if need be and a good DXF converter I found for free on the web.

Sonix.


(Alltaken) #14

ok one thing how fast how much memory does your computer have.

i have been using a 800Mhz celeron laptop with 128Mb, or a 1Ghz P3 with 256Mb.

yes it took me a long time to import the dxf file (100Mb) i found the best way to do it is to walk away once you have started it then you don’t have the temptation to stop it.

i will test a render time now on my 1Ghz using blender 2.23 (1 min 22 sec for a large mesh ~500,000 poly)(compared to the terragen render time of 1.1/2 hour for the texture i think that is good)

once it is in blender format and rem doubles etc have been done it loads in a matter of a few milliseconds. (unoticable)

i will now test a import of the dxf file (103Mb) on the 1Ghz comp and time it for you.

starting time 4:56 pm,
still going at 5:14 pm,
5:31pm still going,
5:56 now and still going. (i have been surfing the web so that may have slowed it down a ittle)
6:04 it finished

~1 hour (i was surfing the web so i may have slowed it downa wee bit but i don’t think i did )

now once i have saved it etc it will open in a flash.

getting it there is the hard part but i think just walking away and having dinner or somthing is a good idea.

hope that helps (it doesn’t crash but it may seem like it so just ignore it till it has finished)

hope that helps you!!!


(Alltaken) #15

I’m trying to use the seemingly easy and clever method pioneered by alltaken to import terragen terrains into Blender. Using For Export Only with terragen, I can export the terrain as a DFX. But when I try to open the DFX in Blender, one of 2 things happens (depending on which method of writing the DFX I use) :

  1. It thinks for a while, then the program is useable, but without an imported DFX to play with.
  2. I see the “working in background” symbol on my cursor, but no thinking light on the PC, and 10 minutes later, there’s still no sign it’ll ever stop pretending to be doing something.

he he he just read your first post again!

yeah its easy and clever but it takes a long time!!! (sorry about that)

there are other ways to do this but i guess for you particular needs this way is the best. (for accuracy of terrain and inblender rendering)

once you have it in blender i sugest you add a randomish bump texture to it and depending on the type of terrain (if rolling hills) set smooth (if jaggy rocks ) don’t set smooth.

sorry i forgot how long it took to get it into blender. but once it is there it is by far the easiest method (you soon forget how long it took)

have fun.


(LukeW) #16

Use Blender’s animation effects, funny bendy arrow icon on header. Add a new effect, select wave, then make X -100 Y -100 wave start -100 wave length 300, change other values to suit.

Then add another new effect in the same window, this will clone the first wave effect, and just change X +100 and Y +100.[/quote]
I can’t find anything called “Wave Length” and I can’t set things like “height” and “width” to 300… BTW, I’m using Blender 2.23. I tried it on a plane which I subdivided a couple times. I’ve tried lots of kinds of lighting but it doesn’t seem to work at all. Could you explain how to do it in 2.23 - i.e. what values I need to change, etc? (The exact names of things) Thanks. I looked at BlenderBase but that didn’t help.


(Alltaken) #17

I can’t find anything called “Wave Length” and I can’t set things like “height” and “width” to 300… BTW, I’m using Blender 2.23. I tried it on a plane which I subdivided a couple times. I’ve tried lots of kinds of lighting but it doesn’t seem to work at all. Could you explain how to do it in 2.23 - i.e. what values I need to change, etc? (The exact names of things) Thanks. I looked at BlenderBase but that didn’t help.

wave animation does not physicaly alter the mesh into a wave form.

you do not have to subdivide a mesh for it either. (it works on a mesh with four vertex’s).

if in edit mode for the mesh you will not see any alteration in the shape so make sure you have selected the mesh but not entered edit mode.

this should help. (just play around with the settings and you should be able to see what does what, it is much simpler than the particle effects)

hope that helps


(Rhysy 2) #18

Many, many thanks to everyone for such thorough replies !

I have a 1.1 GHz (Celeron) PC with 128mb RAM. alltaken, you seem to have a similar system, so I’m guessing that I just didn’t wait quite long enough last time.

Now that I know to expect crazy loading times for DFX files it’s not so bad - it’s a big help to know what to expect ! I’ve got a few hours to play with tomorrow so hopefully I’ll be able to load it then.

I just tested on a much smaller 5mb file - it loads ! Hurrah ! I’m much happier now ! :smiley: :smiley: :smiley:

Okay I played around with it… even on a file this size Blender has split it into 2 different meshes but probably I shouldn’t have saved it as a blend file so soon, silly me. Damn. Anyway I understand the bit about removing doubles, now just one small question to alltaken about the very last bit of his method :

create a plane that is exactly (exactly did i say that already) the size of the landscape from the top view. (delete one edge on this plane).

duplicate it so that there are the same number of planes as pieces of the landscape. join one plane to each piece(this is to get the texture to line up correctly)

I don’t quite follow this bit. You want a three edged plane duplicated to each piece of the landscape ? By piece I assume you mean each seperate mesh ? Also I don’t know what you mean by joining the plane the each section, I can’t see how this would do anything. If you could just clarify this bit, I can get on with blending !


(LukeW) #19

[quote=“alltaken”]

if in edit mode for the mesh you will not see any alteration in the shape so make sure you have selected the mesh but not entered edit mode.

this should help. (just play around with the settings and you should be able to see what does what, it is much simpler than the particle effects)

hope that helps

As I’ve said, I’ve read the BlenderBase link, which basically said exactly what you wrote - and that didn’t help. I didn’t go in edit mode and I still can’t see any difference when I render it. Perhaps making the start X and Y -100 requires the mesh to be big? Anyway I tried that.
Could someone explain how to adjust the wave settings so that it shows up on a mesh? Or they could post a blend file so I can see how they did it. I’ve tried experimenting in lots of ways, and I can’t see any difference in what the render looks like.


(Rhysy 2) #20

LukeW, I have a method that I guarantee will show the wave effects…

  1. Open Blender
  2. Select the default plane, DO NOT ENTER EDIT MODE.
  3. Add a wave effect from the animations buttons. DO NOT ALTER ANY SETTINGS !
  4. Select the camera view (0 on the numeric keypad)
  5. Press and hold the right arrow key and watch the plane bounce !

If you want proper waves, you will have to subdivide the plane a lot and alter the height setting (put it down low). But I am certain you will see some wave effects if you follow the above instructions.