Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Terrain details in the distance.

Author
Message
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 29th Jun 2016 16:16
Looking for ideas to get more details in the distance of a terrain.

The problem is the mip mapping that always when you display a terrain will make you see the textures repeating ( it looks squared ) , in screenshot 2 i tried to use 2 uv scales and mix them together to remove the "squared" look in the distance , it works pretty great , but do have a 6 fps drop , so not really mobile friendly.

Any suggestion to improve , ideas etc... to make this faster would be GREAT

Additional textures is not a option , must be calculated or reuse of current textures.

Not looking for code but mainly ideas that could make it faster and still remove the squared look.

screenshot 1: normal terrain with mip mapping.
screenshot 2: uv mix of same terrain textures.
best regards Preben Eriksen,

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Jun 2016 17:02
Can you use billboards?
Then you could make a detailed landscape with multiple textures, but then convert to billboards and save hundreds of polys.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Jun 2016 19:04 Edited at: 1st Dec 2017 08:30
Are you accessing the mipmap level via a shader ?
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 4th Jul 2016 11:38
janbo: No i dont have access to the mipmap, not sure how to control that in the shaders.

BatVink: That could be a possibility i will look into that , the only problem is i might need a new function like "SetObjectMeshVisible" , terrain is already split into different meshes but i need a way to control what meshes is visible, perhaps there is a way to do that without a new command ?
best regards Preben Eriksen,
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th Jul 2016 12:19
I would repeat the texture at different scales. Like, when you are applying the texture in the shader, use IN.UV (or whatever you have), and IN.UV*2, IN.UV*4, and IN.UV *8

That would help break up the repeating nature but keep it consistent as well, the colours would match and the texture would be repeatable. You could balance things so that the standard resolution is strongest, rather than just averaging it out... like in pseudo code...

dif = texture(1,IN.UV)*0.4f;
dif += texture(1,IN.UV * 2)*0.3f;
dif += texture(1,IN.UV * 4)*0.2f;
dif += texture(1,IN.UV * 8)*0.1f;

It will make the terrain shader a little slower, but it should really break up the repeats so it might be worth it.

You know, I happened across an idea the other day, working on a terrain in DBPro, and there are 2 issues that this idea deals with. On terrains, you can typically calculate the slopes and apply textures that way, with no user input but a fairly basic and limited texture distribution. Another option is to use a mask image, where red, green, blue, and alpha represent different textures, and this image could be calculated automatically or allow users to paint textures. My idea is to hijack the alpha layer on each texture, and use that as a mask for the whole terrain. So the higher the texture resolution, the better the terrain paint resolution. This means that you wouldn't be limited to just 4 0r 5 detail textures, a terrain could use all 8, no need for a mask image, as the mask would be represented in the alpha transparency layer. So, by using the alpha component of each terrain texture, you could have 8 different textures, and having mud, muddy grass, and grass textures would mean your terrains could look a lot more organic and less 'repeaty'. I know you said you couldn't add more textures, and I get the impression that these are levels from GameGuru so you might not have full control over this stuff - but just pointing this out. I have used the alpha layer on textures to hold a height map for cheap relief mapping as well, now that IS effective on terrains - we should find uses for any free image channels I think, especially when you only have 8 to play with.
The code is dark and full of errors
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 5th Jul 2016 11:12
Quote: "I would repeat the texture at different scales. Like, when you are applying the texture in the shader, use IN.UV (or whatever you have), and IN.UV*2, IN.UV*4,..."


Hi Van B. That is what i currently do. "screenshot 2: uv mix of same terrain textures."

I already use the alpha channel in the terrain textures as a specular reflection texture. But the 4 normal map textures do not use the alpha so i might be able to use them for something. i also use your "mask image" but with a calculated rock , and the last color in the mask image to draw vegetation. not to forget the light/shadow texture so i cant really add more textures. but perhaps i can use the alpha for something, thanks.





best regards Preben Eriksen,

Login to post a reply

Server time is: 2024-09-29 15:16:33
Your offset time is: 2024-09-29 15:16:33