• Home
  • Products
    • Game Engine
      • Base
      • Mathematics
      • Geometry
      • Physics
      • Particles
      • Animation
      • Graphics
      • Game
      • Game UI
    • Windows Forms
      • Docking Windows
      • Text Editor Control
  • Downloads
  • Buy
    • Overview
    • Professional
    • Indie
    • Non-Commercial
  • Support
    • Overview
    • Blog
    • Forum
    • License FAQ
    • Documentation
  • About
    • About Us
      • Services
    • Contact Us
    • Press
    • Legal Terms
      • Imprint (English)
      • Imprint (German)
Select the search type
 
  • Site
  • Web
Search
DigitalRune.com
Login |Register
NEWS News RSS Feed BLOG Blog RSS Feed FORUM News RSS Feed DOCUMENTATION DigitalRune Software on YouTube DigitalRune Software on Twitter
You are here: SupportForum

If you want to contribute to the forum discussions, please Register or Login.

SearchHome
  • 1
  • 2
  • 3
  • 4
  • 5
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineTexturing HeighfieldTexturing Heighfield
Previous
 
Next
New Post
7/1/2012 1:38 PM
 
Tmk_d
No Ranking

Joined: 6/3/2012
Posts: 4
Texturing Heighfield 

Hi,

I think my question will be more like 'how to connect some things WITH your engine' rather than exactly about your engine(excuse me :)), But for first let me explain the situation;) I have a map for my game loaded from the png file, i make an Heightmap object from it. Everything works fine, map as a heightmap object exists in the game. Now, i have a colormap also as a png image, and i want to texture my heightmap with that colormap. And here is the problem. I have hlsl effect file, that compiles, and works, but is not texturing te heightfield. I've checked some trivial issues, that i tought can be the problem, but still the only sign of the colormap on the heightmap in game is a single color applied to all of it. 

I guess i miss some 'part', in example assigning texture(colormap) coordinates to the heightmap coordinates? (When we have for example an object (.obj, .3ds etc), the object has texture coordinates i guess). But i don't have a clue, how to do this with the heightmap object. Have anyone ever tried to texture heightmap in such way? Any ideas what can be the issue? 


Thank You very much for any reply :)

 
New Post
7/2/2012 11:35 AM
 
MartinG
7th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 446
Re: Texturing Heighfield 

The vertices of your heightmap probably don't have texture coordinates. That means that the vertex and pixel shaders get the value (0, 0) as TEXCOORD. As a result the entire model only has a single color - the color of texel (0, 0).

In one of our samples we use a custom HeightFieldProcessor to create a heightmap model (incl. texture coordinates) using the XNA content pipeline. The HeightFieldProcessor demonstrates how to create the texture coordinates.

See 

  • <DIGITALRUNE_FOLDER>\Samples\DigitalRune.Physics\General Samples\PhysicsSample\Samples\Sample32 - HeightFieldProcessor.cs 
  • <DIGITALRUNE_FOLDER>\Samples\DigitalRune.Physics\General Samples\ContentPipelineExtensions\HeightFieldProcessor.cs


Alternatively, you could also create the texture coordinates of the heightmap in the vertex shader on-the-fly. (Not recommended for beginners.)

Here is the idea: 

  • In the vertex shader transform the world space coordinates to the local space of the height map. 
  • Divide the x value by WidthX and the z value by WidthZ. 
  • The resulting values are the (u, v) texture coordinates of the vertex, which can be passed to the pixel shader.
 
New Post
7/3/2012 12:43 AM
 
Tmk_d
No Ranking

Joined: 6/3/2012
Posts: 4
Re: Texturing Heighfield 

Thank You very much!! 

That is a lot of information, i will check these solutions for sure, Thanks a lot again. :)

 
 Page 1 of 1
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineTexturing HeighfieldTexturing Heighfield


DigitalRune is a trademark of Garstenauer Information Technology OG.

Garstenauer Information Technology OG
Weingartenstrasse 35, 4452 Ternberg
Austria (EUROPE)
office@digitalrune.com

Home Products Downloads Buy Support About Us
Game Engine Particles Windows Forms Professional Blog Services
Base Animation Docking Windows Indie Forum Contact Us
Mathematics Graphics Text Editor Control Non-Commercial License FAQ Press (News)
Geometry Game Documentation Legal Terms
Physics Game UI Imprint
Impressum
Copyright © 2006-2012 Garstenauer Information Technology OG Terms Of UsePrivacy Statement