Home Technical Talk

what is happening to this cubemap / normalmap / shader / orwhatever

polycounter
Offline / Send Message
rollin polycounter
Hey ho!

I have noticed some strange behavior in 3ds max viewport (2010)

cubewtf.jpg



1: just cubemap: Looks right (not sure if it is really right)

2: just normalmap: Looks right, very less shading errors thanks to handplane.

3: cubemap and normalmap: up is now left but with a wave? .. wtf?!

I used my own and the 3point shader, from where I took the shots, to check the error.

Checked it in unity and it looks different but still strange.

So.. how can it be that the normalmap looks quite good but the reflection is totally wrong. I understand that reflections are very sensitive to small vector changes but how can it result in such heavy distortions?

I'm checking this because the error also shows in normal specular reflections. Here you notice that it feels like it is turned 90°. This is very obvious and I want to get rid of it.

cheers!

Replies

  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    have you tried using scanline renderer, to get some reference image? Right now it's hard to judge without knowing where the light is positioned, how the cubemap looks like (use a map that has more direction clues)

    what you think in 1) looking right, to me looks like vertex normals being bent more, hence you get a curved reflection even on a flat surface. Think of the \ / bending of the normal across the middle surface.
    The normal map looks more like | parallel normals, hence you get a narrow reflection which is actually plausible. How much you see in your reflection depends on the camera FOV. For example in an orthogonal camera, the view direction would be equal for all pixels, which would give you a single color value for all surfaces with the same normal, as a cubemap only stores color per direction.

    Hence saying without know much about the scene properties, it is hard to judge.
  • rollin
    Options
    Offline / Send Message
    rollin polycounter
    Hi :)

    yes I can post some more shots later to give more insight in the setup of the scene.

    I expected a a reflection fitting to a surface that is more flat than the interpolated lowpoly surface. Or lets say this "virtual" surface the interpolation creates. There aren't any additional chamfers.. it's in fact just a simple bevel.

    But the key here is .. how can the shading with normalmap look so good but at the same time the reflection looks so wrong.
    I'd love to have a way to show per-pixel normal vectors to check what's going on there.

    Anyhow.. with such a reflection I would have expected a really bad normalmap shading.

    I'll try to record some gifs and supply a zip with a testfile if I don't find a mistake on my side (workflow, bug in model, whatever).
  • equil
    Options
    Offline / Send Message
    are you sure the resulting normal is in the correct space? for cubemaps you usually want world space normals while normal mapping tends to result in tangent space normals.
  • rollin
    Options
    Offline / Send Message
    rollin polycounter
    Hi equil, had the same thought first but then checked a few different shader. I doubt that all shader developer have implemented a wrong reflection code. At least I hope ;) But to get away from the cubemap and to show the core Problem I've recorded a small gif here.

    Notice how the reflection movement is rotated by 90°. And it moves in the opposite direction on the other side of the mirrored geo. If it moves on the right side up it moves on the left side down. But of course it is not moving to the left and right as it should do.

    You can see the wires. It's nothing special but of course a nearly 90° angle the normalmap has to compensate. But again: the shading looks good.. but the spec is wrong.

    reflection_wtf3.gif


    edit: somehow i have the feeling that the shading is in this case on the edge of getting bad and only the reflection shows or very extreme lighting situations reveals it. It's just so strange that especially this part of the models acts that extreme event though there are other parts which are modeled, unwrapped and baked the same way

    Just in case someone wants to check: Testfile max 2010
  • rollin
    Options
    Offline / Send Message
    rollin polycounter
    ok totally forgotten to check and that's the solution


    max gnaaaaaaaaaaaaaaa display ts-bug

    using 3points quality normal modifier totally fixed it

    cheers!!
Sign In or Register to comment.