Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 05:57

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 09.01.2013, 13:18 
Offline

Joined: 07.01.2013, 16:36
Posts: 1
I want a large, flat terrain that is devided in 1x1 tiles. I want to be able to change the color of the tiles at runtime, so for example, I want the tiles to be red when they are near an enemy, and blue when they are near a player. How do I do this in horde3d?

I eventually want to be able to show at least 250x250 tiles on screen. Do I create 62k scenenodes for it? I'm quite new to horde3d and game rendering in general. I still find things like shaders, textures, materials and rendering pipelines hard to understand.

Thanks!


Top
 Profile  
Reply with quote  
PostPosted: 14.01.2013, 19:34 
Offline

Joined: 23.07.2009, 21:03
Posts: 51
Location: Germany
DnDiene wrote:
I eventually want to be able to show at least 250x250 tiles on screen. Do I create 62k scenenodes for it? I'm quite new to horde3d and game rendering in general. I still find things like shaders, textures, materials and rendering pipelines hard to understand.

Hi.
I guess there are a lot of clever ways this could be achieved.
For example, if it is just a debug thing, have you considered drawing the tiles around your characters using plain OpenGL calls?

My Horde3D based suggestion would be to use a dynamic texture:
  • create an properly uv-mapped plane and import into your scene, 250x250 meters in size.
  • create a 250*250 pixels texture within your application using h3dCreateTexture.
  • set the new texture to the "albedoMap" sampler in the plane's material.
  • add Filter = None; in the model.shader file to the albedoMap-sampler definition to get "sharp boarders".
  • change the texture in your app depending on your characters' position.

Doing it like this, you almost don't have to worry about the pipeline or shaders at all. And you'll learn using custom textures and how to apply them to an object's material using the Horde3D API.
You'll lose texture filtering for all your albedoMaps, which easily avoidable by creating an new, simple shader for the plane.

Regarding the texture setup, this should be all you need to do (add H3DResFlags::TexDynamic when setting up the texture):
http://www.horde3d.org/wiki/index.php5? ... _a_texture
Just keep the default "albedoMap" sampler name for now, if you want to avoid messing with shaders.

Hope it helps. Cheers


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 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