Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Feb 2004
    Location
    United Kingdom (South)
    Posts
    991
    It'll definitely be interesting to see how that approach goes. I've pretty much taken the TP Character videos to their conclusion now so I'm now back to working on the diamond patch style. First step I think will be to try converting the UV approach I originally took to the plan I made above.

    OK... that was pretty simple.

    The changes made to the formulas to position the vertices were moved across to place the UVs with ((Size - 1) * Spacing) to scale to a range of 0-1. (of course doing so results in the uvs being placed from the center of the texture out but this could be changed with an offset if required. The changes gave the following result:


    That was fine but there would be a seam in the texture each time a new patch started because of my triangle height being less than 1 unit. I thought I needed to get a new parameter into the call for the terrain patch to record the number of patches worth of spacing I would need to offset by. I realised that I already had the information I needed being passed into the terrain patch in the form of the vector. It gave me a number for the current patch position so I made the CreateGrid method accept a float parameter and passed in the z component of Position. I used that to add an additional offset to the uvs in z when making each patch. That lead to the image you see below!


    Next thing that might catch this out is the decision on when to generate new patches and remove the old ones. I think I can get around that with some compensation for the position in Z along the patch. I can adjust the required distance from the patch centre in x by the normalised z position. This will probably be more important at later stages when handling problems that might not occur in a square patch.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Stage1_Remap_UVs.png 
Views:	141 
Size:	394.2 KB 
ID:	71498   Click image for larger version. 

Name:	Stage2_Remap_UVs.png 
Views:	148 
Size:	390.5 KB 
ID:	71499  
    Last edited by Avace; 03-22-2011 at 03:55 PM.

  2. #12
    Join Date
    Feb 2004
    Location
    United Kingdom (South)
    Posts
    991
    Right starting to get some height data in on the square patches. I've also combined my two terrain patch classes and will be using an enum to allow me to switch between the two types for testing. This will save typing / copying pasting code that does not change with the patch type. Seems like there is quite a lot for me to catch up on to get up to the latest R&D videos. So far so good.



    The diamond version is now working but you'll notice it's not the same part of the image. That's because I moved a unit up before I took the grab on that one. I'll have to do a direct comparison of both running together to make sure I have the vertical scaling correctly compensated for both versions.

    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	heightincoming.png 
Views:	142 
Size:	130.0 KB 
ID:	71503   Click image for larger version. 

Name:	heightdiamond.png 
Views:	138 
Size:	146.1 KB 
ID:	71504  
    Last edited by Avace; 03-22-2011 at 08:24 PM.

  3. #13
    Join Date
    Sep 2010
    Location
    New York
    Posts
    57
    you may want to drag and drop the grass texture as shown in the later videos (not that far off), it will better demonstrate any giant seams in the screen grab. I would also slightly darkened the bright white shade color.

  4. #14
    Join Date
    Feb 2004
    Location
    United Kingdom (South)
    Posts
    991
    Quote Originally Posted by tomo View Post
    you may want to drag and drop the grass texture as shown in the later videos (not that far off), it will better demonstrate any giant seams in the screen grab. I would also slightly darkened the bright white shade color.
    Hey again tomo . This was a quick test before I went to sleep but I'll definitely try it with a green texture as you suggest. Bright white does hurt my eyes but it also provides a good contrast to the grey background when the terrain is not in shadow. At first glance I don't see as many seams in the diamond shaped patches but that could just be luck with the height variation across the lines where the slanted seams pass and I've certainly not tested it at all thoroughly.

  5. #15
    Join Date
    Sep 2010
    Location
    New York
    Posts
    57
    here is an example of the seams. You see that the patches side by side have a long black line running. This is the line where the triangles are halves.


    This is a better picture as I had made it brighter with an angle. Notice how the patches look like long rectangles and not individual squares. If you switch tex-wire to texture you'll still notice the pattern in the UVs.

    Last edited by tomo; 03-22-2011 at 09:24 PM.

  6. #16
    Join Date
    Feb 2004
    Location
    United Kingdom (South)
    Posts
    991
    Hmm... the first and last images there show the mesh structure. This will emphasise any appearance of a seam as there are a greater concentration of vertices along the vertical seams in the geometry. In the second image it looks as if there is a texture wrapping issue in addition to any apparent seam. Is the uv position being offset to take account of the patches position so that it wraps correctly?

    Going back to the first and last images if the height of the vertices in the middle of triangle faces was an average of the vertices on their immediate left and right it should create the appearance of a mesh made purely of triangles. I haven't been far enough in to the project yet to see if this was tackled in Lee's approach but it wouldn't surprise me if it had.

  7. #17
    Join Date
    Oct 2009
    Posts
    123
    Okay, I found a problem with the zig-zag layout I have been experimenting with - I can't step down the vertex density for a LOD system because it doesn't tesselate.

    Ooh, idea while typing - I could conform the edges of the higher-LOD patches with the outline of the lowest LOD so each patch is the same shape. I wonder if that would be a massive pain. Well, I'll come back to the LOD thing after I've caught up on the rest of the project progress.
    ( ! ) Assets/_Scripts/TP_Camera.cs(50,35): BCE0000: WTF?

  8. #18
    Join Date
    Sep 2010
    Location
    New York
    Posts
    57
    UPDATE - It works. Yay!
    Quote Originally Posted by tomo View Post
    I'm glad this trail pop up. How about this pattern ? Get rid of those giant seams. Though I cannot say if the idea will work

    Lee gave it a shot. For those of you following this trail check out VTM 130 to see it in action (11:20 ). When Lee get's a chance he'll need to include a 2nd image of the revised patch as my image is flipped vertically from the pattern used. Basically the same though.

    A note about the jagged pattern. Later on we could probably cap the ends of the world so that patches look more squarish or even have the end result dynamically add triangles that fill in the contour of the overall shape of the world. This would only make sense for sculpting, as it wouldn't for players walking through a world that is loading in bits and pieces based on TPC location. This is assuming the sculptor can zoom out and edit a larger section of the terrain as a whole.

  9. #19
    Join Date
    Dec 2002
    Location
    Virginia Beach, VA
    Posts
    861
    I wouldn't even bother putting them in for sculpting as it greatly increases the difficulty of calculating some of the tools like smoothing and then the system would have to know not to save that information as it isn't needed at game time. Just leave them jagged besides if you are zoomed out far enough to see the edges of the world you can't tell anyways.

  10. #20
    Join Date
    Jan 2011
    Location
    Blackpool, UK
    Posts
    853
    Quote Originally Posted by chronos78 View Post
    Just leave them jagged besides if you are zoomed out far enough to see the edges of the world you can't tell anyways.
    Or just squint your eyes.

Page 2 of 2 FirstFirst 12

Posting Permissions

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