Terrain Screenshots

Started by
138 comments, last by JD 19 years, 9 months ago
Not quite as good on a single quad. Your eyes are actually very good at picking out distortions from the change in height, even at a very high angle. It looks quite a bit more flat if it were a single quad, but it doesn't take much geometry at all to fix that.

Another option that I plan on implementing is Parallax Mapping, which does adjust the texture coordinates to give that 3d-looking effect while still being a single quad. I suggest you look it up, it appears quite simple to implement.

Implementing bumpmapping was really just an experiement, since I actually have very high quality geometry anyway (although it's still a lot better than per-vertex lighting!). The scene you're seeing there is usually drawn with 3k polygons.
Advertisement
Quote:Original post by Anonymous Poster
So your not using the masks that come with farcry, but rather some kind of hack to apply the appropriate detail textures depending on the color of the base texture?


im stuck with the demo and to be honest while i think the cover.ctc file has a higher resolution base texture i couldnt even figure out the format. i guess examining the xml files closer would tell me where the masks are (or maybe cover.ctc IS just that?).

that and i think i have to fiddle with the detail textures anyway to make sure the "empty" parts are white and dont change the base color.

and no, its not even a hack, its worse. its the wand tool just to get anything using some very roughly appropriate detail textures (not to mention im stuck with only four of them and i think far cry used more than that)
f@dzhttp://festini.device-zero.de
I didnt figure out either what the .ctc file is good for but i dont think its too important since my terrain looks pretty original without having read it. So maybe its really just a highres basetexture or something - who knows :)
The masks do a good job in defining where the detail textures need to be applied.
Quote:Original post by Dtag
I didnt figure out either what the .ctc file is good for but i dont think its too important since my terrain looks pretty original without having read it. So maybe its really just a highres basetexture or something - who knows :)


i remember someone elses terrain using a 2048 base texture (also from far cry) and the sizes would roughly match. but i guess it cant be that important then ,-)

Quote:
The masks do a good job in defining where the detail textures need to be applied.


guess i will have to look for them. but then, later they will be created either through slope or an editor anyway. btw. are you using detail textures all over or fading them out and draw far away terrain without? i would have expected a big fillrate saving by doing that but in the end it was only slightly faster while looking pretty bad (obviously, as the brightness is completely different).

it sucks if you want to do all in one pass and are stuck with 4 tex units (as the moment i use 5 fps are cut in half and i could just as well use multiple passes.. id even expect that to be a little faster than 50%). putting them in one big texture results in ugly seams.. unless maybe i move the tex coords by one pixel and copy the edge pixels of the textures.
f@dzhttp://festini.device-zero.de
For each chunk, I determine 4 or less of the total layers that will be used for detail texturing. So there is no multipass involved.
My detail textures are only applied to chunks with a LOD 0 ( Iam using geomipmapping so this is a nice way to roughly control the distance ). In order to remove the seams at the edges, I fade the detail texture out in the distance. All this is done in my vertex shader which looks like this ( its GLSL ):
[VP]

varying vec2 texCoord0;
uniform vec3 eyePos;
uniform float lodBias;

void main(){    texCoord0=gl_MultiTexCoord0.xy*64.0;    vec3 diff=eyePos-gl_Vertex.xyz;    float inten1=1.0-clamp(dot(diff,diff)/(15000.0*lodBias),0.0,1.0);		    gl_FrontColor = gl_BackColor = gl_Color*inten1;    gl_Position = ftransform();}


As you can see, the intensities of the detail textures are multiplied with the distance dependent intensity. So the fragment shader doesn't note anything of all this which should make the whole thing nicely fast ( didn't explicitely benchmark it yet tough )
Quote:Original post by Dtag
As you can see, the intensities of the detail textures are multiplied with the distance dependent intensity. So the fragment shader doesn't note anything of all this which should make the whole thing nicely fast ( didn't explicitely benchmark it yet tough )


in my crude test i just used two programs. one sampling the base texture and one also modulating the blended detail textures to it. i think it was about 10fps difference, which in this case would be about 3-4%. no blending, just rendering all up to 200 units away (terrain is 1024) with details. no water either, because its not just looking horrible but eats a ton of fillrate. how are you doing the reflections? rending the terrain twice, rendering the scene to a texture? my favorite solution would be rendering the scene to a cubemap at lower detail, but that still sounds too expensive and id expect the cases to be very rare, where something offscreen is reflected (except the sky and ground maybe). maybe i could away with updating that map only every few frames.
f@dzhttp://festini.device-zero.de
"one sampling the base texture and one also modulating the blended detail textures to it"
thats only possible when you have 3 or less detail layers

my reflection works like this:
Reflection Texture:
Mirror the camera pos at the camera plane
Make a clipplane that is slightly below the water plane to avoid cracks.
Render everything to the reflection texture.

Refraction:
Make a clipplane that is slightly above the water plane to avoid cracks.
Render everything to this refraction texture.

--

Render one big quad, projecting both the reflection and the refraction texture on the quad. Additionally I have 2 normalmaps that scroll along the water in slightly different directions. They perturb the reflection/refraction lookup texcoord which results int the waves.



Rendering to a cube map doesn't really make sense for an ocean because its too big to look good. Afaik, cubemap reflections should only be used for reflective objects in a world

Sorted out the errors in the mesh generation... once i am done packaging it all up i will move onto to making highres and morecomplex mesh construction methods...
-----------------www.stevemata.com
Quote:Original post by Dtag
"one sampling the base texture and one also modulating the blended detail textures to it"
thats only possible when you have 3 or less detail layers


4 actually. one per color channel. but i cant dynamically change which textures are used so im stuck with sets of 4 (unless i change back to using color detail textures).

Quote:
Render one big quad, projecting both the reflection and the refraction texture on the quad. Additionally I have 2 normalmaps that scroll along the water in slightly different directions. They perturb the reflection/refraction lookup texcoord which results int the waves.


the normalmap is something im worried about. ill definitely have to forget about "correct" waves. a small normal map looks lousy and updating a big normalmap will most likely be to slow (iterating over every pixel once every or every few frames).

Quote:
Rendering to a cube map doesn't really make sense for an ocean because its too big to look good. Afaik, cubemap reflections should only be used for reflective objects in a world


thats my problem with cube maps in general. to make it "right" you would need to render the whole scene from a view point set to the point of intersection. something better left to raytracing.

im also wondering how far cry did it. they have those really ugly looking "edges" that seem somehow pixelated where water meets shore.

for now im already glad to have fog working. still wondering why i have to calc the fogcoord myself (not to mention that fog is really hurting my speed, so maybe i'll change back to linear and do it myself in the fragment program).
f@dzhttp://festini.device-zero.de
Dybbuk, I really like that first pic ie. the valley. Imagine putting GTA3:Vice City into the valley allowing the player to also offroad in the suburbs. I think the scale is a bit off though, the hills should be bigger. But the problem is when you get the player closer to the ground you going to loose some details because the height field is bit coarse at those levels. Maybe a detail mesh could overlay this heightfield terrain to provide street details like curbs and such. I think it would be hand made in an editor. I think those hilly areas are perfect for heightmaps to handle since hand extruding them would be a pain.

This topic is closed to new replies.

Advertisement