Normal Mapping

Ok, so the past few hours I have been working on getting a model I have made into Panda with normal maps. I have failed. I have gotten models into panda and animated them also, so I can’t understand why I can’t get my model now to work. I have followed the tutorials in the Manual to a tee, but It’s still not working, any one have a clue about what to do?

Which modeling package are you working from?

Hmm, did you call setShaderAuto on your model to enable normal maps?

Im using Maya 8.5, and I’m using the same code from the normal mapping sample. The only difference is that I’m loading in a model I created.

Have you generated the tangent and binormal ? Maya2egg is supposed to do that, by until now it seems not.
Use “egg-trans -h” to see the complete options.

Hi all,

is it possible to export a mesh from 3DsMax and attach it with a normal map
(in X or Egg-Format)?

I tried to use the normal map tutorial. But I saw its only for Maya?

Currently the Max exporter doesn’t support those fancy features yet. But it has been overhauled in Panda3D 1.5.3 to support normal maps. Version 1.5.3 will be released very soon, with the new Max exporter.

What do you mean with overhauled to support normal maps? Improved? Or to put it out of the engine? :unamused:

And what is in your eyes soon? One month? One year?

With overhauled I mean rewritten and lots of new features.
And actually, the new release (1.5.3) has been released yesterday. So just grab it from the download page.

Thnx, pro-rsoft for this information. i tried out this new version and the normalmap-tutorial. but it doesnt run with my mesh from 3dsmax. still no normal map effect visible. Any idea?

Did you enable per-pixel lighting? (press ‘p’ in pview or call render.setShaderAuto() in your code)

Yes, setShadrAuto is in my code an I pushed also p in pview…no improvment.
I think, the problem is still the 3dmaxtoegg exporter. In the Egg-Sample for Tuturial to Normal Mapping the syntax of the vertex looks like this

<Vertex> 1 {
      -60 0 -60
      <UV> {
        -0.5 -0.5
        <Tangent> { 1 0 0 }
        <Binormal> { 0 1 0 }
      }
      <Normal> { 0 0 1 }
      <RGBA> { 1 1 1 1 }
    }

But the Max exported egg looks like this:

<Vertex> 1 {
        0.26145 -0.63104 0.0593912
        <UV> { 
           0.899183 0.107776 }
        <Normal> { 9.74811e-008 -1.02784 1.35505e-006 }        
      }

and the Polygon in Sample:

<Polygon> {
    <Normal> { 3.91309e-009 1 3.91309e-009 }
    <TRef> { phong1SG }
    <TRef> { phong1SG.tref2 }
    <VertexRef> {
      93 90 79 133 72 57 117 119 118 115 114 112 110 108 29 4
      <Ref> { polySurfaceShape2.verts }
    }
  }

and final with 3dMaxExporter:

<Polygon> {
      <RGBA> { 1 1 1 1 }
      <TRef> { phong1SG } 
      <VertexRef> { 1294 1295 1296 <Ref> { polySurfaceShape2.verts } }
    }

So the information to the normals still missing via 3dMaxExport…
[/code]
[/quote]

I think (but am not sure) this is because binormals and tangents are missing in your file.
The maya exporter does this automatically for you, but the max exporter seemingly doesn’t. Panda3D provides a commandline tool to generate the binormals and tangents for you:

egg-trans -tbnall inputfile.egg -o outputfile.egg

Then the outputfile.egg should be the same as inputfile.egg but with binormals and tangents.

Thnx, for the info Pro-rsoft. Now it works! :slight_smile: