New test build: 20110222 posted

Get it at the usual place.



There were one or two bug fixes but mostly I upgraded JME3 to the latest nightly and updated my shaders accordingly… hoping against logic that this might fix some of the texture issues some users are having. I didn’t see anything in the changes that would fix them but there is a certain amount of black magic to shaders. So maybe.



My own testing shows I’ve lost about 10 FPS (out of 80) that I can’t account for yet. I’ll look into that more tomorrow to see if it was just the JME3 upgrade or if I did something stupid when I was getting things to work with it.



Oh, and I modified the clip distance to default to maximum. (And no, the FPS isn’t that because I always tested with full clip on. :))

Hmm… still the same problems. Sure you use the current Lighting material + associated shaders?

Some early morning building while having some coffee, seems to be working well :slight_smile:



1 Like
Dodikles said:
Hmm... still the same problems. Sure you use the current Lighting material + associated shaders?


Yes, I painstakingly copied over the changes line by line by hand until the only difference between my shaders and JME's were my changes for fog and baked in lighting... and there's nothing about that that would screw up the bump mapping. In fact, I saw no changes that would fix or harm the bump mapping.

Do the JME3 bump mapping examples work for you? There may only be one that uses it: TestSimpleBumps. Oh, and TestEverything seems to use it for the brick... that's under the effects tests.

If those work like they are supposed to then I will drill in further on what the differences between my code and those tests are.

mhhh btw…what changes did you made in the fog an lighting shaders?

Maybe these changes could be included in the core

Fog… I’m guessing, yes definitely. Though I may have done it in a really screwy way. For all of my bravado (heh), I’m a shader noob.



The lighting I do is sort of specific to my use-case since I bake a “sun factor” and a “local light factor” into my vertexes. And the sun factor even scales ambient in some ways so as to make the shadows show up better. It’s all kind of funky and I’m sure it could be improved by a better eye. By the end, when what was logical didn’t work, I just started randomly poking until it looked like I wanted.



The fog I do is straight-forward. I was trying to emulated the simpler aspects of standard gl fog. I know it can be improved, though, because I calculate the fog per pixel right now rather than just mixing it with a varying fog color setup in the vertex shader. For shaders, when I get it working at all, I’m loathe to touch it again unless I have to. :wink:

oh! you don’t use the FogFilter, you use fog in the lighting shader?



And btw who cares about noobishness while it looks good heh? :wink:

nehon said:
oh! you don't use the FogFilter, you use fog in the lighting shader?


Yes. I didn't necessarily want everything to be foggy. Just things with my material on them. So a post-processing effect seemed wrong (and a little wasteful) given my understanding of how it worked.

Yeah the FogFilter was a workaround to implement Fog at first… i admit we did not put much effort lately to workaround this workaround :stuck_out_tongue:

Implementing all of the different glFog options was beyond me but a simple:

[java]

float fogFactor = exp2( -fogDensity * fogDensity * depth * depth * LOG2 );

fogFactor = clamp(fogFactor, 0.0, 1.0);

gl_FragColor =mix(fogColor,gl_FragColor,fogFactor);

[/java]



…was pretty straight forward. I may have even ripped that from the post-processing fog.



I was going to see if I could clean it up and push more into the vert shader but I see I’ve done some things that make that a more than five minute job. I may just post what I have somewhere and let smarter folks sort it out. :slight_smile:

Actually the fog might cause it

Some cards do not properly check for proper values in the functions, even though it says so in the spec, so you might need to clamp() the inputs yourself.

I’ll wait to see if they also have a problem with the regular JME tests of bump mapping… since it seems weird that fog would screw up only on the bump mapped materials… and water, but that’s a separate issue.


I call this one … No tree left behind :wink:

It’s beautiful.