User panel stuff on forum
  13 posts on 1 page  1
Client Talk
2009-03-25, 21:48
Member
60 posts

Registered:
Apr 2006
http://www.quaketastic.com/upload/files/screen_shots/ezq_pertubation.png


As you see bump-mapping works but I am only computing a perturbation normal not a normal map normal. To get my light-direction I loaded a deluxe map I generated in FTE Quake which seems to be a stored average of all the light directions on the map. Unfortunately I am having a horrible time getting normal mapping working from here and I don't really see what the problem could be. For now I will have to put it on the back-burner unless someone can give me some direction. Theoretically there shouldn't be a problem since perturbation works and I seem to have the right tangent. Oh well, on to other things, I will revisit this later.

*Update - normal mapping fixed:

http://img18.imageshack.us/img18/6480/ezqbump.png


**Update Bump w/ Gloss:

http://img300.imageshack.us/img300/1913/ezqbumpgloss.png
2009-03-26, 09:01
Administrator
1864 posts

Registered:
Feb 2006
Spike?
2009-03-26, 15:44
Member
271 posts

Registered:
Feb 2006
.lux files should be in object space.
Just draw them without bumpmapping as a single texture and ensure that they're some sort of light shade of blue. That applies to your bumps/normalmaps too.
Basically the normalmap and lux map need to be similar colours (identical = no bumps, complete contrast = bumps going the wrong way).

Ensure the textures are normalised. FTE does this as part of lightstyle blending/uploading. I'm not sure how effective doing that in the glsl would be.

The maths you want is (normalmap dot lux) * diffuse * lightmap
There's no need to consider surface normals/orientation/rotation.

Happy now, Zalon?
moo
2009-03-26, 16:09
Administrator
1864 posts

Registered:
Feb 2006
I'm always happy
2009-03-31, 23:52
Member
60 posts

Registered:
Apr 2006
Thanks for the reply spike. I finally had a chance to sit down and look at this again. My code was fine, the problem was because I accidentally was loading the spec map as the norm map (programming blunder of the year.) Here's just bump w/o spec:

http://img18.imageshack.us/img18/6480/ezqbump.png


Spike: The maths you want is (normalmap dot lux) * diffuse * lightmap

Multiplying the diffuse by the light-map gives me the wrong pixel values in glsl. In order to get the right values I do a blend:
vec3 pixel = mix(base_map.rgb, gl_TextureEnvColor[1].rgb, light_map.rgb);

This also has the added benefit of blending dynamic lights properly.
2009-04-01, 00:22
Member
271 posts

Registered:
Feb 2006
Yeah, forgot to mention that normalmaps being textures (logically 0 to 1) means you need to scale and bias them in order to make them actual normalmaps, mneh. still, if it works it works.

Is it my imagination, or are you lighting the far side of the bricks? The lights on the wall highlight the bottoms of the bricks when there's meant to be a torch in that corner somewhere in the middle of the right edge. Certainly none at floor level. The floor also looks lit away from the corner rather than the parts that ought to be facing, though I'm not quite sure where the brighter lights are here.
moo
2009-04-01, 00:44
Member
60 posts

Registered:
Apr 2006
It does look a little like that. I wrote a function that renders orbs at all the non-torch light locations. As you can see the torch lighting on the floor looks correct so I think the light-orb in the hallway is offsetting the wall lighting.

http://img18.imageshack.us/img18/7966/ezqbumplighting.png
2009-04-01, 01:28
Member
60 posts

Registered:
Apr 2006
I checked all the texture mappings and the only thing that seems inconsistent for causing a few lighting abnormalities is the deluxe-map. Is this how it looks in FTE or did I miss something:

http://img8.imageshack.us/img8/7694/ezqlux.png
2009-04-15, 15:10
Member
60 posts

Registered:
Apr 2006
Bump/Gloss update:

http://img300.imageshack.us/img300/1913/ezqbumpgloss.png
2009-04-15, 15:30
Member
271 posts

Registered:
Feb 2006
You know what the next step is though, right?

Use the blah_bump texture (presumably packing the heights into the alpha channel of the normalmap) and displace the texture based upon viewing angle.
So that your bricks really do stick out of the surface.

And yeah, when using bumpmapping, pre-baked lighting on your diffuse textures really does spoil the effect.
moo
2009-04-15, 16:51
Member
60 posts

Registered:
Apr 2006
Yeah that's a good idea. Spike while I have your attention, I'm getting some strange behavior where at some angles the rendering of some (not all) faces gets fudged:

Here the face is wrong:
http://img148.imageshack.us/img148/8150/ezqglslerror.png


Here the face is correct:
http://img142.imageshack.us/img142/4651/ezqglslerror2.png


This problem seemed to have disappeared for a time and has recently returned. I'm guessing it has to do with some default behavior. Have you encountered this or any ideas what the problem could be?
2009-04-15, 22:25
Member
60 posts

Registered:
Apr 2006
nvm it's just a problem with passing the texture coords so it's not related to anything else in the shader code which is why it's an intermittent problem.
2010-01-12, 19:38
Member
793 posts

Registered:
Feb 2006
bumping this with this.
any progress here? we could really use this!
  13 posts on 1 page  1