View topic - Make Your Maps Shiny(er) With SSMF



All times are UTC + 1 hour


Post new topic Reply to topic  [ 74 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: 09 Feb 2010, 22:20 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Note how close the camera is zoomed in, and yet the map does not look like shit. Achieved by splatting 4 different detail textures on.


Top
 Offline Profile  
 
PostPosted: 09 Feb 2010, 22:53 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
...which means when normalmaps arrive, the epicness will be complete :-)


Top
 Offline Profile  
 
PostPosted: 09 Feb 2010, 23:02 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: There is no god - and reality is his prophetess
this wont turn into another sm3 debugdebakel?
i mean, will it be easy to use, just two additional black&white textures for mapconverter, one telling how strong the effect is, the other which detailtex is applied were?


Top
 Offline Profile  
 
PostPosted: 09 Feb 2010, 23:16 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
PicassoCT wrote:
this wont turn into another sm3 debugdebakel?
i mean, will it be easy to use, just two additional black&white textures for mapconverter, one telling how strong the effect is, the other which detailtex is applied were?

Currently that is exactly how its done.
Im not sure about normal maps, to be honest, we seem to be doing a pretty good job of burning them on, and Im not sure that low resolution normal maps would even have a point, and resolutions on par with the smf textures might be a big load


Top
 Offline Profile  
 
PostPosted: 09 Feb 2010, 23:26 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
If the normalmap tiles were tiled like a detail tex, then they'd be plenty high in resolution, and add a terrific amount of apparent detail. Combine with a big spectex to determine the scale / color of said specularity, and there you go- map-wide control, lots of small details up close.

I guess you misunderstood where I was going with that, basically- I don't want normalmaps at the spectex resolution, that would look like ass.


Top
 Offline Profile  
 
PostPosted: 09 Feb 2010, 23:35 
Moderator
User avatar

Joined: 23 Nov 2005, 06:16
Location: Dunedin, New Zealand
Beherith wrote:
Note how close the camera is zoomed in, and yet the map does not look like shit. Achieved by splatting 4 different detail textures on.

Ahh, looks good man.


Top
 Offline Profile  
 
PostPosted: 09 Feb 2010, 23:48 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Kloot, where do I have to dig around to add a tdf parameter to a map? I got it all in the engine, but the path string is hard coded atm cause I dont know what part of the code parses the tdf files. Just like the specularTex=... bit.

I know this sounds really noobish, but I did a ctrl+f on the codebase for speculartex and couldnt find any part relating to tdf loading :(


Top
 Offline Profile  
 
PostPosted: 09 Feb 2010, 23:59 
Lua Coder
User avatar

Joined: 20 Feb 2007, 01:10
Beherith wrote:
Currently that is exactly how its done.
Im not sure about normal maps, to be honest, we seem to be doing a pretty good job of burning them on

Wait, you mean baked-in normal maps? I thought normal maps were impossible to bake since they simulate real geometry and change appearance correctly when camera moves?


Top
 Offline Profile  
 
PostPosted: 10 Feb 2010, 00:08 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Let me rephrase that; we use normal maps to bake lighting into the terrain knowing that the suns direction is fixed. And the results are quite decent.


Top
 Offline Profile  
 
PostPosted: 10 Feb 2010, 00:59 
Spring Developer

Joined: 08 Oct 2006, 15:58
Beherith wrote:
ill try more to reproduce it.


Do any of the textures that I uploaded get tiled if you assign them to your SSB map? One solution I have lined up would be to split the spectex into 1K chunks, but I'd rather not go there yet (unless this is a problem for more people too).

Also, can you verify that it always happens when sizeof(spectex) > 1024, or only when sizeof(spectex) > [sizeof(diffusetex) / 8]?

Quote:
I dont know what part of the code parses the tdf files.


SMD parsing is the domain of the maphelper Lua scripts.


Top
 Offline Profile  
 
PostPosted: 12 Feb 2010, 00:00 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Texture split bug is still there, but im ignoring it for now, as I have run into this:

Im passing a detailtexture distribution map to your shader, its a uniform sampler2D

If I use your code:
Code:
vec4 detailCol = normalize((texture2D(detailTex, gl_TexCoord[4].st) * 2.0) - 1.0);


Then fps is 400 in my benchamrk case, and cpu use is 50%

If I use my code in the fragment shader (vertex shader unchanged, notice I use the speculartex coords for the detailtex distribution, fragment shader also the same with only these parts changing)
Code:
   vec4 dc = (texture2D(detailTex, gl_TexCoord[4].st) * 2.0) - 1.0;
   vec4 dtd = texture2D(detailTexDist, tc2);
   float delta= dc.x*dtd.x + dc.y*dtd.y + dc.z*dtd.z+ dc.a*dtd.a;
   vec4    detailCol = vec4( delta,delta,delta,0.5);

Then I get 380 fps, but 100% cpu use. I get this cpu use difference consistently every time I try this.

I also did
Code:
float delta= dot(dc,dtd);

instead of
Code:
float delta= dc.x*dtd.x + dc.y*dtd.y + dc.z*dtd.z+ dc.a*dtd.a;

In my solution, but that kept the 100% cpu use, and resulted in 2% less frame rate.
Im using a widget to set up pre defined camera states for benchmarks, and am using low terrain detail to make sure the gpu is doing alot of texture filling work.


Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 13:31 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Been working on this.
What it still needs: water absorbtion - though that can be done without, if the perf cost is too high.
And map base fog - i wouldnt mind this going at all.

CPU use issue is unrelated.


Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 13:51 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
More of what it can do:

Image


Image

At the moment it can do a common, adjustable resulution based splatting of 4 different grayscale detail textures and and adjustable intensities for each detail texture. No performance loss on my hardware.


Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 19:23 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Kloot rocks! http://github.com/spring/spring/commit/535b480b190f9a3b0745745f8bc82b4059a33c2a

I have a few questions though:
Spring seems to use manhattan distance for fog. Doesnt length(vec3) use sqrt? Is this a performance hit?
Also, is this shader using the compatibility profile? Because if so, why not use the built in in float gl_FogFragCoord ?


Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 20:02 
Spring Developer

Joined: 08 Oct 2006, 15:58
Euclidean distance actually (standard for linear fog), so there was always a sqrt involved.

I think you mean gl_FogCoord (gl_FogFragCoord is an out-parameter for vertex shaders), which needs to be initialized via the FFP to be usable.

Water absorption will be cheap enough; I've got it almost-done locally.

Is your patch in a releasable state yet? ;)


Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 20:11 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
OK... so...

1. Is this in current master yet?

2. If so, how do we test it out?

3. It still won't respond to light angles?

Really impressed with that beach, btw.


Last edited by Argh on 01 Mar 2010, 20:14, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 20:14 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
I am very close to release, just need a smart way to handle fallback to the case where there is glsl map rendering but no detail tex splatting (fallback to old dtex)

Also, is there any reason we are not defining alot of the stuff as const?


Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 20:16 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
If we want it to look correct for the lighting angle, we have to do that manually though, I take it?

And yes, there have been reports suggesting issues with const and ATi, although I really have my doubts that's the real problem.


Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 20:19 
Spring Developer

Joined: 08 Oct 2006, 15:58
Argh wrote:
OK... so...

1. Is this in current master yet?


Yes (as you could have inferred from the rest of this thread).

Quote:
2. If so, how do we test it out?


Read the first post.

Quote:
3. It still won't respond to light angles?


What?


Beherith wrote:
Also, is there any reason we are not defining alot of the stuff as const?


ATI's tend not to like it.


Top
 Offline Profile  
 
PostPosted: 01 Mar 2010, 20:20 
P.U.R.E. Developer
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
Quote:
What?
IOW, it's just a color overlay with alpha, not a bumpmap? I know it creates a specular highlight, but I'm trying to understand how that interacts with the camera angle, that's all.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 74 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.