Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Best way to texture 3d landscape?

  1. #1

    Best way to texture 3d landscape?

    IF I was going to (hypothetical question) make 3d island models, draw the models to a scene, render the water over the top and around the islands...

    1. Does the water automatically fit around the islands?
    2. Is there any way to make the water more transparent as it gets shallower? Like depth fog but constrained to the inside of an object...
    3. How can I texture the islands? With one big texture plonked over the top of it? Can I access the water model at runtime and make waves? Will these waves go up and down the beaches of the islands?

    If I WAS to go 3d, could I still draw my pritty 2d effects over the top?

    thanks for any questions you may be able to answer. thanks for reading this even if you can't help. and thanks for ummm nothing otherwise?

  2. #2

    Best way to texture 3d landscape?

    I am no expert of 3d stuff. I know that it looks very complicated. I have tried combining 3d objects (text rotating) with 2d stuff drawn in the background and found that it is possible. I needed to set z-enabled off and on depending if I was drawing 3d or not. However, it sounds like you want to go fully 3d.

    It would be great if someone would make a 3d wrapper to make 3d programming a bit easier. Sort of like what asphyre and omega did for directx 2d programming and glxtreem did for opengl.

    However, you might get some ideas by looking at these demos

    http://www.delphisanctuary.com/forum...opic.php?t=553
    The views expressed on this programme are bloody good ones. - Fred Dagg

  3. #3

    Re: Best way to texture 3d landscape?

    Quote Originally Posted by lief
    1. Does the water automatically fit around the islands?
    The z- or depth-buffer will automatically handle this for you.

    2. Is there any way to make the water more transparent as it gets shallower? Like depth fog but constrained to the inside of an object...
    At run-time, yes, but it could get expensive, ie. slow. You would have to check every vertex and see how deep the water was there. This would usually be done as a table lookup if you used a height map for your terrain. Then set the alpha component of the vertex colour to suit according to the depth.

    I would do this as a pre-processing step. The idea behind this is to pre-process these values since they are usually not going to change over the lifetime of the game, so why repeatedly calculate the same values over and over each frame? Create the water mesh beforehand and set the vertex alpha for every vertex, then store this in a data file somewhere. At run-time, read that data file in and use that to draw the water. Less processing at run-time means higher frame rate and more CPU time to do other cool stuff.

    3. How can I texture the islands? With one big texture plonked over the top of it? Can I access the water model at runtime and make waves? Will these waves go up and down the beaches of the islands?
    Here is a document by Charles Bloom on 'texture splatting'. Fairly theoretical with no practical examples.
    http://www.cbloom.com/3d/techdocs/splatting.txt
    Here is a practical example of using the above technique in DirectX9.
    http://www.gamedev.net/reference/art...rticle2238.asp

    You implement the water model however you want. Here at Krome, we generally make a grid for the water and punch holes in it where it will not be seen. The quickest polygon is the one you do not draw. This is treated just like any other model, with the exception of a few special effects to make the surface look watery (offsetting vertices, texture effects, etc). The z-buffer (as mentioned above) makes sure that the square edges of the water grid are hidden beneath the ground. Using the vertex offset effect, yes it looks like waves going up and down the beach. But this effect can be costly if you have too many vertices to offset each frame. This is best done using a vertex shader or something similar.

    If I WAS to go 3d, could I still draw my pritty 2d effects over the top?
    Of course. Draw your 3D using a perspective projection matrix, then switch to an orthographic projection to draw the 2D effects in whatever two-dimensional space you specify. You would also usually disable z-buffer writing and reading during this 2D drawing. This is the HUD elements of most games are drawn.

  4. #4

    Re: Best way to texture 3d landscape?

    Quote Originally Posted by lief
    2. Is there any way to make the water more transparent as it gets shallower? Like depth fog but constrained to the inside of an object...
    Steve got the point there. Also, you can use one big texture with alpha-channel which gets more transparent in some areas. You can even modify this texture at run-time to reflect any changes.

    Quote Originally Posted by lief
    3. How can I texture the islands? With one big texture plonked over the top of it? Can I access the water model at runtime and make waves? Will these waves go up and down the beaches of the islands?
    First, multi-texturing would be logical step to improve the overall look of the island. Second, you can generate a model at run-time but, as always, Steve got good point there

    Quote Originally Posted by lief
    If I WAS to go 3d, could I still draw my pritty 2d effects over the top?
    This can be just as easy as if you didn't have 3D stuff at all. And if you use Asphyre (err, this is Asphyre forum right? ), it automatically provides state changes for you, so just draw 2D after 3D (or before, if you want it to appear as background for 3D scene)

  5. #5

    Re: Best way to texture 3d landscape?

    Quote Originally Posted by Lifepower
    Steve got the point there. Also, you can use one big texture with alpha-channel which gets more transparent in some areas. You can even modify this texture at run-time to reflect any changes.
    Personally, I would avoid using a very large texture with alpha. That's an expensive texture if it is 32-bit, and depending on the size of the water, the texture resolution may need to be quite high as well. I would use a smaller texture to represent the water surface without alpha, and set the translucency using the vertex colours of the water grid.

  6. #6

    Re: Best way to texture 3d landscape?

    Quote Originally Posted by Sly
    Personally, I would avoid using a very large texture with alpha. That's an expensive texture if it is 32-bit, and depending on the size of the water, the texture resolution may need to be quite high as well.
    What if you use multi-texturing and use the second texture in 8-bit alpha format?

    Quote Originally Posted by Sly
    I would use a smaller texture to represent the water surface without alpha, and set the translucency using the vertex colours of the water grid.
    Talking about optimization, wouldn't this require more heavy vertex format that include vertex colors and the additional blending options? Looks like more bandwidth and more per-pixel processing, although I agree that multi-texturing might not be that cheap anyway...

  7. #7

    Best way to texture 3d landscape?

    It would best be decided by trying both approaches and seeing which one works for the situation.

  8. #8

    Best way to texture 3d landscape?

    Thanks a heap guys! Keep in mind this is for low tech old laptop...
    has about a card which supports some directX 7? 8? and nearly no OpenGL (software drivers only, i have to use some scitech directX emulated OpenGL thingo). I'm not even sure if it supports multitexturing, i sure hope so...

    So...

    1. Make a giant plane for water, give it a tiled water texture, make it shiny and transparent

    (I have already done the above using a hand-made-3d-thing similar to 2d iso landscape demo in asphyre, but it wasn't all that cool... no z-buffer to stick islands through water with, and when i did make a software zbuffer, the only framerate i could get that was nearly decent was around 20fps at about 256 x 256 rendering area...)

    2. Make some island models
    3. Make an individual texture for each one that works well
    4. Load the island models and precalculate the alpha - adjusting the vertice alpha depending on depth below water

    rendering loop
    5. Wiggle the water vertices for viewable area using a sinus function of some kind
    6. Draw the islands in the viewable area (i'm using a top down view, the camera basically stays static, so its simply just a rectangle for the screen I draw)
    7. Draw the water
    8. Draw anything I want on top, player models etc

    i have read the texture splatting articles, slightly too complex for me at this stage... and like i said i have no idea what my laptop can handle past putting colored rectangles on the screen (jk - it runs games like ummm age of sail 2, however halo didn't work)

    thanks again peoples

  9. #9

    Best way to texture 3d landscape?

    Draw all opaque models before the translucent water. This way, the opaque models can go in the water and you will see their lower half under the water as well as their top half above the water.

  10. #10

    Best way to texture 3d landscape?

    the water will work as a plane object yes? I dont need to make a big box?

    i still have a query on the texturing of models within asphyre... how is it done?
    set one texture for each model? are UVmaps supported? or do i need to make a seperate model for every texture section on an object? how does it wrap around? arghhghgh DAMN 3d! STAY 2d FOREVER SO I AM HIGH TECH!
    a$%#%@@

Page 1 of 2 12 LastLast

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
  •