|
many thanks again Philip,
your answer was very clear and
detailed..
so i guess i'll stuck with 2-3 detail textures (i
don't need a lightmap, cause lighting is done by vertex normals..)
but i still don'T know how to texture my terrain
now:
is it possible in java3D to blend those 2-3
detail textures together depending on the height value..?
if not perhaps depending the vertex color
?
till now i generate a unique texture from the
height-data and four detail-textures for every part in the map:
______________________
|
|
| |
|
|__12_|__13_|__14_|__15_|
|
|
|
| |
|__8__|___9_|__10_|__11_| |
|
| |
|
|__4__|___5_|__6__|__7__|
|
|
|
| |
|__0__|___1_|__2__|__3__| here every part'S texuture is generated with following
algo.
(in my app i got 128x 128 parts each with a big stride)
but is this necesary, because every textures is mixed from only
four..?
how do you apply your terrain textures ?
greetings
Michael Nischt ------------------------------ e-mail: [EMAIL PROTECTED] homepage: http://zero.atariflys.de --------------------------------------------------------------- .... for(int y=0; y < height; y++) for(int x=0; x < width; x++)
{
heightValue = heightmap[(y*width)+x]; for(int i=0; i < cnt;
i++)
{ texFactors[i] = getTexFactor((cnt-(i+1))*part, heightValue+1.0f); colorBits = textures[i].getRGB(x,y); red[i] = (colorBits & 0x00ff0000) >> 16; green[i] = (colorBits & 0x0000ff00) >> 8;
blue[i] = colorBits & 0x000000ff;
}
for(int i=0; i < cnt; i++)
{
mixedRed +=
texFactors[i] * red[i];
mixedGreen += texFactors[i] * green[i];
mixedBlue += texFactors[i] * blue[i];
}
mixedColorBits = mixedRed
<< 16 | mixedGreen << 8 | mixedBlue;
mixedImage.setRGB(x,y,
mixedColorBits);
mixedRed = mixedGreen =
mixedBlue = 0;
}
return mixedImage;
}
...
|
- [JAVA3D] multitexturing and OpenGL Extensions Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions David Yazel
- Re: [JAVA3D] multitexturing and OpenGL Extens... Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions Charmaine Lee
- Re: [JAVA3D] multitexturing and OpenGL Extensions Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions Joachim Diepstraten
- Re: [JAVA3D] multitexturing and OpenGL Extens... Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions Philip Taylor
- Re: [JAVA3D] multitexturing and OpenGL Extens... Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions Philip Taylor
- Re: [JAVA3D] multitexturing and OpenGL Extensions Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions David Yazel
- Re: [JAVA3D] multitexturing and OpenGL Extensions Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions David Yazel
- Re: [JAVA3D] multitexturing and OpenGL Extens... Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions Allan Andersen
- Re: [JAVA3D] multitexturing and OpenGL Extens... Joachim Diepstraten
- Re: [JAVA3D] multitexturing and OpenGL Extens... Michael Nischt
- Re: [JAVA3D] multitexturing and OpenGL Extensions Yazel, David J.
- Re: [JAVA3D] multitexturing and OpenGL Extens... Allan Andersen
- Re: [JAVA3D] multitexturing and OpenGL Extensions Philip Taylor
