Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: Heightmap Channel  (Read 20121 times)
April 12, 2008, 08:55:01 pm
A few months ago I created a heightmap channel and now I have decided to make it avaible to the community. Smiley
For those who don't know, a heightmap is a greyscale texture which represents some sort of landscape/terrain where white is heighest and black lowest.
The channel is created for Quest3D 3.6.6, haven't compiled it for 4.0 yet.

The channel has four child links:
- the first is a texture channel, your heightmap
- the second is a objectdata channel which will contain the created terrain model
- the third (maximum height) is a value channel which is optional, you can set this to scale the height
- the fourth (scale) is a value channel which is also optional, you could set it to scale the x and y

The basics working of this channel is as followed:
The channels main input is a heightmap texture, once called it will read all the pixels and convert it to the objectdata channel.
When the max height value is avaible it will be used to cap the height of your heightmap to this value using scaling. For example: a white pixel represents a height of 255, when the max height is set to 60 a white pixel will only be 60 high.
When there is a scale value is avaible it will be used to scale the x and y of your map. This is very handy to reduce the number of vertices/polys. For example I have a 128x128 heightmap, which will result in 16384 vertices. When I set the texture (in the texture channel itself) to be 64x64 and the scale to 2 the size of the object will remain the same (128x128) but will have only 64x64=4096 vertices.

I supplied a zip with:
- the heightmap channel, should be placed in the %Quest3D install folder%\Channels\
- a example cgr with 4 cool examples

As a feature there is also a shader used to render the terrains with multitexturing and blinn/phong lighting. You check that out in the object section.

If you have any questions or suggestion please post them here or email me lhoenderdos at xs4all.nl

You are allowed to use this in commercial projects, I would appreciate it if you inform me about this when this happeneds.

* Heightmap Channel Q3D 3.6.6.zip (7.9 KB - downloaded 633 times.)
* Heightmap Channel Q3D 4.0.zip (7.93 KB - downloaded 672 times.)
* Heightmap Example.zip (3665.42 KB - downloaded 1225 times.)
* HeightMapChannel Q3D 4.2.1.zip (7.76 KB - downloaded 706 times.)
April 13, 2008, 12:49:47 am
Too cool, Lukas!  I'm looking forward to playing with this.

~Rhys
April 13, 2008, 06:38:04 am
Thanks you, Lucas very good Plugin Cheesy
April 13, 2008, 09:59:37 am
I have some potencial cool ideas:
- What if you could control the "selected mipmap in a texture channel"? Then you could create terrain with dynamic LOD
- Using the custom texture channel from Dylan Fitterer one could paint his terrain realtime or make something like ground which cracks open or create footprints when a bigfoot walks by

Although I still need to find the time to realise this ideas. I am very anxious to see what the community creates Smiley
April 14, 2008, 08:10:41 am
Fantastic!!!
Thanks Lukas.
Do you have time for compiled to 4.0 version?

Regards
April 14, 2008, 08:35:44 am
now i see Smiley
Excellent one Lukas.
April 16, 2008, 10:42:43 pm
Thank you Lukas,
I've been praying for someone would come up with a way to load heightmaps. I'm using L3DT to create a 120km sq landscape! Please compile for 4 when you get the chance?
April 17, 2008, 08:18:06 am
I will try to compile it to 4.0 when I find time, I should be able to get it done this weekend. I will also include the used shadercode so there is a starting point for users.

My ideas using the heightmap channel and custom texture will not work Sad Custom texture is too custom, you can't use a texture as input, unfortunately you always need to produce textures procedural.

I hope more people come to play with this, I wanne see some pretty examples Wink
April 17, 2008, 10:28:35 am
Hi Guys
Here comes the first example:)
 It can be a scary mountain... or if you zoom out...a nice looking girl...


* mountain.jpg (79.57 KB, 600x606 - viewed 838 times.)

* madonna.jpg (91.63 KB, 600x606 - viewed 762 times.)
April 17, 2008, 11:26:10 am
Ha! That was actually also one of the first things I did when I created the channel  Grin

I also just came across the first bug; the objectdata won't update as it should in my example.

You need to open the heightmap texture channel before using it! I think I know whats causing it so it will be fixed this weekend.
April 19, 2008, 09:02:18 am
Here is the first update!

Not much has changed:
- Compiled the channel for Quest3D 4.0
- Updated the example; the shadercode is now avaible and I've added a simple light animation

When you start the example, its blank. Just press left or right to see something. I left the objectdata empty so the cgr was a bit smaller. (its still quite big)
The shader code could probably use some optimalisation, I'm just glad its working Smiley

You can find the 3.6.6 and 4.0 versions and the updated example in the start post.

Ohh, before I forget:
I also just came across the first bug; the objectdata won't update as it should in my example.

You need to open the heightmap texture channel before using it! I think I know whats causing it so it will be fixed this weekend.
I can't reproduce this bug at home so I'm a bit in the dark. If this bug happends, please tell me and we will find a solution.
April 19, 2008, 05:37:12 pm
I'm testing right now.  Possible to post the .igr for the example cgr?

~Rhys
April 19, 2008, 05:43:17 pm
Sorry, my bad! Added and updated example in start post
April 21, 2008, 02:22:37 pm
It works without a hitch.  Very nice, Lukas!  I'm definitely going to use this at some point.  I just wish I had it earlier for the project I'm just now finishing.  This was just what I was looking for.

Have you tried it with a MediaTexture, yet?  I bet the recalculations would be prohibitive, but I'm still curious.

~Rhys
April 21, 2008, 04:40:43 pm
Hey Lukas, did you save the example in 4.0 format? I can't open it, I see this message

"A channel (component) is used in this channel group that is not installed in your version. It could be created in a newer version of Quest3D or with a different set of components installed. Please contact the creator of the channel group and ask him about his Quest3D version."

Also, I can't see the channel in the list after placing the .dll in the channels folder, I've tried with both 3.66 and 4.0 version, how is it called inside q3d?
Anyone else had this problems? I'd really like to try this channel Smiley
Pages: [1] 2 3 4   Go Down
  Print  
 
Jump to: