My "close to me" terrain is rendered in a grid of cells 100m x100m each. My
"far-from-me" terrain will be rendered by a quadtree, with the "close-to-me"
quads (of the quad-tree) disabled.
I have a thread that sleeps until you move some number of meters, then it
wakes up and scans and asks the landscape cells to build themselves if
necessary. Each 100m x 100m cell has a list of registered
PositionedBuilders. Each positioned builder has a reference to a carpenter,
plus information on location, scale and rotation. It determines how far
from the person it is and decides to build either a low, high or far version
of the node. If it needs one, it asked the carpenter to build it, and
passes it the builder information. The carpenter checks its cache and if it
has a discarded version, it updates the transform and passes ownership back
to the LOD cell. For example as you move through a forest the high detail
trees are removed from behind you and placed in front of you. If you have
moved farther away, the cell can return the objects back to the contractor.
The contractor gives the objects out if needed, then ages and kills them.
The carpenter objects themselves are written to use shared groups and links
where applicable.
Each LOD cell is also responsible for building its own texture. After
experimentation I found that a 64x64 texture multitextured with a 128x128
detail wrapped 10 times looks good. This is mapped to the 100m x 100m
shape. The main cell texture is calculated quickly and uses a small amount
of texture memory. Each LOD cell has a switch node with multiple children,
one of which is the mesh, which is formed in a grid of 5x5 vertices which is
50 triangles in a single triangle strip array. The cell mesh is switched
off once out of view and eventually discarded. The texture is cached in
memory and eventually spooled to disk, making about 1.1 k per texture. The
next time that texture is needed it is loaded rather than calculated,
although if I decide to go with texel lighting I will have to age them
quickly or risk having the shaded areas be out of sync with the sun.
Dave
----- Original Message -----
From: Shawn Kendall <[EMAIL PROTECTED]>
To: Discussion list for Java 3D API <[EMAIL PROTECTED]>; David
<[EMAIL PROTECTED]>
Sent: Wednesday, November 22, 2000 8:20 PM
Subject: Re: [JAVA3D] Multi-texture question
I'm still a little fuzzy on the main texture. In the end, is it one
single texture that is produced by your texel blending or, are you doing
the blending at the TextureUnitState level?
If it is one big texture, how big? 512x512?
Thanks.
David wrote:
> Shawn:
>
>
>
> The detail texture is the same across rocks and grass. The main
> texture is generated by blending 2 or more textures at each texel
> based on certain criteria. The most common criteria I use is to blend
> each texel based on the texel normal in relation to a normal
> perpendicular to the x,z plane. Thus, the slope of the terrain at
> that texel.
>
>
>
> The detail texture is indeed a very real problem for transitions from
> one type of terrain to another, where the detail texture makes no
> sense. An example of this might be a transition from rock to snow, or
> from sand to water. I am pretty sure the only way to solve this is to
> overlap the polygons and for the "top" texture set the texture alphas
> at the texel level to maintain a smooth non-linear transition.
> Thankfully this should only be needed in a smaller number of cases.
>
>
>
> The model for the man was converted by the tool called "3d
> Exploration" into 3ds format from a halflife model, then loaded into
> java3d using John White's 3ds loader. We have not even begun work on
> animations yet because it is more important to get the world to a
> point where our non- technical types can work on balance, gameplay and
> world building. As funny as it sounds, animation is eye candy, albiet
> some of the most important.
>
>
>
> The overlay is in a JWindow, but all the graphics for chat history,
> etc is painted using a graphics context, so when I am ready to try
> video textures again I will build the textures using the same code.
> In my mind the chat box needs to be translucent because it takes up so
> much real estate.
>
>
>
> Dave Yazel
>
> Cosm Development Team
>
> ----- Original Message -----
>
> From:Shawn Kendall <mailto:[EMAIL PROTECTED]>
>
> To:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
> Sent: Wednesday, November 22, 2000 4:54 PM
>
> Subject: Re: [JAVA3D] Multi-texture question
>
>
> Hi David,
> Great looking snapshot! I have two questions for ya.
> 1) Is the detail texture on the rocks and the ground the same? It
> looks like it but not quite sure - didn't see any seams though so
> it must be....
> 2) Is the "main" texture is a procedure generate full color image
> that is mapped perfectly to the terrain?
>
> If these are true, right now you can't get any detail pattern
> changes across different types of surfaces (i.e. rock or grass).
> Is that correct? It think this is the trade we have to make to
> get continuous looking textured surfaces...
>
> Also, the character is looks great, what format?
> Also, your overlays... are they running good, if so, which J3D
> version?
>
> Looking good!! (I think you need some particles :-) )
>
> David wrote:
>
>> I got multi-texture working. Looks like using the methods to set
>> a single vertex are not working with multiple sets. I just
>> changed it to build the array of floats then set them all at
>> once. That worked perfectly. I have it working in OpenGL on a
>> NVidia TNT ultra card using j3d 1.2.1 beta
>>
>>
>>
>> Here is a picture of it in action. The terrain textures are
>> procedural generated blending based on slope of each texel. Note
>> how the grass gives way to rock.
>>
>>
>>
>> Dave Yazel
>>
>> Cosm Development team
>>
>>
>>
>>
>>
>> ----- Original Message -----
>>
>> From:Shawn Kendall <mailto:[EMAIL PROTECTED]>
>>
>> To:[EMAIL PROTECTED]
>> <mailto:[EMAIL PROTECTED]>
>>
>> Sent: Wednesday, November 22, 2000 2:33 PM
>>
>> Subject: Re: [JAVA3D] Multi-texture question
>>
>>
>> I have worked with multi-texture quite a bit now and I have
>> run into many, many problems. However, all but one were in
>> our code. It's just gets confusing very quick!
>>
>> I'd like to see the entire exception dump. Check like crazy
>> (as if you didn't!) and if it won't come clean. If not,
>> "whip" up some test code. The Java3D team has been
>> outstanding lately in running and checking test apps.
>>
>> David wrote:
>>
>>> I am getting a null pointer exception when I try to set a
texture coordinate
>>> for unit state 0. When I created the triangle strip array I
asked for two
>>> texture sets like this:
>>>
>>> public TriangleStripArray getGeometryDefinition( int
vertexPoints, int
>>> perStrip[] ) {
>>>
>>> Log.log.println(LogType.EXHAUSTIVE,"Creating multitexture
geometry");
>>> int texMapping[] = {0,1,1};
>>>
>>> return new TriangleStripArray(vertexPoints,
>>> GeometryArray.COORDINATES |
>>> GeometryArray.NORMALS |
>>> GeometryArray.TEXTURE_COORDINATE_2 |
>>> GeometryArray.COLOR_3,
>>> 2,
>>> texMapping,
>>> perStrip);
>>>
>>> }
>>>
>>>
>>> Later I try to set the texture coordinates for a single vertex
like this:
>>>
>>> triangles.setTextureCoordinate(0,vertex,new
TexCoord2f(texX,texZ));
>>> triangles.setTextureCoordinate(1,vert!
>>> ex,new
>>> TexCoord2f(texX/densi!
>>> ty,texZ/density));
>>>
>>> In the only example of this I could find, they were calculating
an array of
>>> floats and just setting the entire unit state texture coords
like this:
>>>
>>> // specify texture coordinates for texture coordinate set 0
>>>
>>>> geo.setTextureCoordinates(0, 0, texCoordSet0);
>>>>
>>>> // specify texture coordinates for texture coordinate
set 1
>>>> geo.setTextureCoordinates(1, 0, texCoordSet1);
>>>
>>>
>>>
>>> Am I missing something? I am trying to multi texture a detail
texture over
>>> another texture.
>>>
>>> Dave Yazel
>>> Cosm Development Team
>>>
>>>
===========================================================================
>>> To unsubscribe, send email to [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> and include in the body
>>> of the message "signoff JAVA3D-INTEREST". Fo!
>>> r general help, send email to
>>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> and include
in the body of the message "help".
>>>
>>>
>>
>> --
>> ___________________________________________________________
>>
>> Shawn Kendall Full Sail Real World Education
>> Course Director 3300 University BLVD
>> Real Time 3D for Gaming Winter Park FL 32792
>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
http://www.fullsail.com
>> ___________________________________________________________
>>
>>
===========================================================================
>> To unsubscribe, send email to [EMAIL PROTECTED]
>> <mailto:[EMAIL PROTECTED]> and include in the body of the
>> message "signoff JAVA3D-INTEREST". For general help, send
>> email to [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>> and include in the body of the message "help".
>>
>>
>> ---------------------------------------------------------------------
---
>>
>> <cid:[EMAIL PROTECTED]>
>>
>> cosm26.jpg
>>
>> Content-Type:
>>
>> image/jpeg
>> Content-Encoding:
>>
>> base64
>>
>>
>
> --
> ___________________________________________________________
>
> Shawn Kendall Full Sail Real World Education
> Course Director 3300 University BLVD
> Real Time 3D for Gaming Winter Park FL 32792
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
http://www.fullsail.com
> ___________________________________________________________
>
--
___________________________________________________________
Shawn Kendall Full Sail Real World Education
Course Director 3300 University BLVD
Real Time 3D for Gaming Winter Park FL 32792
[EMAIL PROTECTED] http://www.fullsail.com
___________________________________________________________
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".