Results 1 to 10 of 14

Thread: Heightmap Terrain flicker

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    my guess is you should try reducing the distance between the far and the near clipping plane which will increase the depth accuracy. you may also scale the whole landscape down to around 100x100 to improve the floating point accuracy. and finally you may want to change the depth format to D3DFMT_D24S8 instead of D3DFMT_D16 (assuming that you don't use that format already). btw what's the size of the landscape?

    the landscape looks kind of upside-down here.
    Attached Images Attached Images
    Last edited by Dan; 31-03-2012 at 02:29 PM.

  2. #2
    i use depth format D3DFMT_D24X8, as for the size, it is 32x32 vertices scaled by 1500, i tried having the scaling very small and it was exactly the same problem, however i tried changing the near/far clipping plane and this seems to do the trick so thanks, what do you think would be a good value for these both?
    Download the Ziron Assembler
    Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.

  3. #3
    the difference between the near and far plane should be as small as possible. I normally try not to go over 1000

  4. #4
    excellent thanks, i will keep that in mind

    about the landscape upside down, that is because i temporarily disabled culling, and the camera is starting below the surface, you can just fly up above the geometry - it is intended just for testing with for now
    Download the Ziron Assembler
    Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.

  5. #5
    dont mind if I show off my landscape here?
    Attached Files Attached Files

  6. #6
    that looks pretty good - i have moved onto texture splatting now, once i finish with multi-texturing my terrain, i will re-post also
    Download the Ziron Assembler
    Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.

  7. #7
    seems i have broken something, i can't understand why this is happening, my code for loading raw heightmaps is as follows:

    Code:
      SetLength(vertices, F_Vertices);
      iVertices := 0;
      AssignFile(f, filename);
      Reset(f, 1);
    
      // Loop across and up
      for iy := 0 to F_VertsY-1 do begin
        for ix := 0 to F_VertsX-1 do begin
          BlockRead(f, height, 1);
    
          // Create the verts
          vertices[iVertices].x := (ix*tScale);
          vertices[iVertices].y := height*tHeight;
          vertices[iVertices].z := (iy*tScale);
    
          vertices[iVertices].u := ix;
          vertices[iVertices].v := iy;
    
          Inc(iVertices);
        end;
      end;
    
      CloseFile(f);
    I have not changed anything since last night regarding heightmaps, but today it is doing some weird sheeat

    screenshot >



    any ideas?


    Never mind, seems my heightmap was corrupt

    new screenshot >

    Last edited by Colin; 01-04-2012 at 01:19 PM. Reason: My Mistake
    Download the Ziron Assembler
    Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •