Home Technical Talk

tangent basis / viewport shaders etc.

poopipe
grand marshal polycounter
Offline / Send Message
poopipe grand marshal polycounter
I know there'a lot of literature on the subject available on this very forum but I have a specific question and frankly after 90 minutes reading I'm bored.

the question is...

Is it possible to force max (2012) to use a given tangent basis for rendering normals using a DX viewport shader?

ie. can I write a shader that definitely matches my engine?

Replies

  • AlecMoody
    Options
    Offline / Send Message
    AlecMoody ngon master
    I'm fairly certain the short answer is no. Max doesn't expose tangent basis for editing.
  • EarthQuake
    Options
    Offline / Send Message
    You might be able to write a customer shader that is synced up to your engine, but you won't be able to force Max to bake in that tangent space, so it would be useless. You're better off syncing your engine to Max's tangent space.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    the key question is who bakes your tangents, as that is the tangent-space everything should be in sync with.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    I'm (painfully) aware of the render vs baking aspect but I believe I'll be able to do something with xnormal in that respect. We're not in a position to change the engine since it's already public and in use on an awful lot of devices wth an awful lot of content so our only recourse is to make changes to the art pipeline.

    The shader won't be useless because the artists will be able to see what they're getting and use that information to shift seams or whatever is required to hide artefacts without going through the rigmarole of export and viewing - a process that's further complicated by our preview renderer not playing nice with ATI cards.

    However if what AlecMoody says is correct I'm buggered anyway - unless I can do something via the SDK...


    Doesn't the 3 point quality normals modifier do something along these lines? I din't really pay a lot of attention last time I used it


    edit:

    Thanks to a post by a certain mr Cloward elsewhere on the interweb I've established I can do "something" that affects this - I've managed to break my specular lighting and make seams very obvious so I assume I'm on the right track :)

    if I can actually wrap my head around this to the degree where I can explain it ill try to put something up as it could prove useful
  • AlecMoody
    Options
    Offline / Send Message
    AlecMoody ngon master
    Crazybutcher wrote the 3point shader so he is probably best to explain how they did it. My understanding is that they have a max modifier that creates its own tangent basis and copies those tangents into another mesh channel. Their shader reads those tangents instead of the original mesh tangents.

    My concern is that while this worked for syncing max scanline and max viewport there are likely to be other factors for your engine that are going to be more difficult to replicate.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    As Alec wrote it, our modifier uses 3 uvw channels to put the tangent space data there and read that in the shader. So it's perfectly doable. It is also doable to make max render normalmaps into a different tangent space. If your studio is already a 3point customer I'd be fine to share some source code and directions on what to do.
Sign In or Register to comment.