Horde3D

Next-Generation Graphics Engine
It is currently 22.12.2024, 17:46

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Custom Terrain
PostPosted: 30.07.2008, 07:16 
Offline

Joined: 29.07.2008, 19:49
Posts: 11
hi i want to assing a custom color to every triangles on a terrain, is there anybody who can help me ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Terrain
PostPosted: 30.07.2008, 12:06 
Offline

Joined: 17.02.2008, 21:08
Posts: 24
Location: Switzerland
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Terrain
PostPosted: 31.07.2008, 14:19 
Offline

Joined: 29.07.2008, 19:49
Posts: 11
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Terrain
PostPosted: 31.07.2008, 14:25 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
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.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Terrain
PostPosted: 31.07.2008, 15:36 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
or calculate the color directly in the shader using the y value


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Terrain
PostPosted: 04.08.2008, 15:06 
Offline

Joined: 29.07.2008, 19:49
Posts: 11
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 ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Terrain
PostPosted: 04.08.2008, 15:42 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
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.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group