Horde3D
http://horde3d.org/forums/

Custom Terrain
http://horde3d.org/forums/viewtopic.php?f=1&t=449
Page 1 of 1

Author:  onurakkaya [ 30.07.2008, 07:16 ]
Post subject:  Custom Terrain

hi i want to assing a custom color to every triangles on a terrain, is there anybody who can help me ?

Author:  reiko [ 30.07.2008, 12:06 ]
Post subject:  Re: Custom Terrain

Do you mean triangle, or vertex? It would be fairly straightforward to modify the terrain extension to include a per-vertex color channel. Also, depending on your use case, you might want to consider just using another texture.

Author:  onurakkaya [ 31.07.2008, 14:19 ]
Post subject:  Re: Custom Terrain

thanks for your reply but i just want to implement colors by

0 100 meters 255 0 0
100 300 meters 0 255 0
...
...
...
etc
for example higher hills to red lowers to green

Author:  swiftcoder [ 31.07.2008, 14:25 ]
Post subject:  Re: Custom Terrain

onurakkaya wrote:
thanks for your reply but i just want to implement colors by for example higher hills to red lowers to green
Create an image containing the gradient of colours you want, and then just apply that instead of the detail texture, in the pixel shader, using the y coordinate of position as the texture coordinate.

Author:  Volker [ 31.07.2008, 15:36 ]
Post subject:  Re: Custom Terrain

or calculate the color directly in the shader using the y value

Author:  onurakkaya [ 04.08.2008, 15:06 ]
Post subject:  Re: Custom Terrain

i created an image and replaced to detail.jpg but it didn't work. on the screen i see detail.jpg tiled
i want to stretch detail.jpg to whole terrain so i can give colors higher hills to red lowers to green is there any way to implement this?

and i am newbie in horde3d and i dont know syntax of the shader.xml so i couldn't choose colors in the shader.xml is there any documentation about the horde3d's xml files (shader.xml , scene.xml etc) and its functions ?

Author:  swiftcoder [ 04.08.2008, 15:42 ]
Post subject:  Re: Custom Terrain

onurakkaya wrote:
and i am newbie in horde3d and i dont know syntax of the shader.xml so i couldn't choose colors in the shader.xml is there any documentation about the horde3d's xml files (shader.xml , scene.xml etc) and its functions ?
You are in a little bit over you head at this point. Start off by learning GLSL (OpenGL Shader Language), which is the code present in the shader.xml files. There are many tutorials on the web, just use google, or grab a book from your local library.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/