Normal Maps and animated Actor in chicken r74

Does chicken export normal maps from animated model?
When i click in preview and then press P my model is all black.
With a static model i’ve no problem.
Thanx

It certainly does - its not any different than for a static model, at least for Chicken. I have to admit though that I just tested it to make sure there was no regression and whilst the file exported was correct I could not see the effect of the texture, but could see via the per pixel lighting that the shader generator was working. Not sure why that is but I certainly wasn’t getting black - could just as easily be my computer or the fact I’m using a cvs build as anything else.

No idea what your problem is though - would need more information. But at a guess you have messed up the setup somewhere - there are a whole bunch of settings that if got wrong could make it go black. Make sure its a tangent mapping normal map the whole way through - texture is both generated as such and then marked as such when applied, including in the file tab. Also open the file in a text editor to check that the textures are there with type ‘normal’. Also check that Chicken doesn’t emit any warnings.

hi lethe

I don´t know what happen either!
I´m using Blender 2.49 in window xp.
My character got texture 1=Color, texture2 = NormalMap (with the options normalMap: Tangent checked).

I got no warnings from chicken. These options are checked:

  • force relative tex
  • tangent and binormals
  • preview

When in preview i press L to light and then P to pixel-light. But my animated model is all black. I import it in my code and render.setShaderAuto() then the model appear all with black squares in texture.

If you got some idea i would be pleasure.
Thanx

Well, I am going to need more info. If you can send me a copy of the model - .blend and your exported .egg, plus its textures that is the easiest solution. Alternatively the first bunch of lines for the egg file might be enough - egg files are just text files that you can open in notepad etc. The start will contain the texture/material definitions etc, which is where its probably gone wrong.

Hey lethe

I´m on work, but i did a quick orico mini-man without ears for you

http://rapidshare.com/files/258129327/texugoModels.rar.html

with the blender model and egg exported and textures (of course ! ) :smiley:

See and try!

Thanx bro

Well, your setup is correct, the egg file looks correct and when I open it in pview I get no blackness - it looks fine. I did this under Windows with a straight 1.6.2 install as well. However, I couldn’t see the normal maps effect - it was certainly having an influence, as drawing on the normal map showed up, but I couldn’t see any evidence of a normal map despite seeing the effect of per-pixel lighting, so I am having issues with this as well. When I re-exported it as a static mesh it all worked fine. In other words we are both having a problem, just with different symptoms. Whatever the issue is it is going to have to be resolved by someone who knows Pandas shader generator, which probably means pro-rsoft.

I can’t get the file from RapidShare - can either of you email it to me?

Email sent.

Guys

I try with another configurations but without sucess.
I did the normal map in XNormal, but with other resources (zbrush, gimp´s normalmap plugin) i got the same result :confused:

Thanx :wink:

It looks like Chicken isn’t exporting the Binormals/tangents. I see no or tags in my animated .egg files, but they are present in my static files.

I further confirmed this by modifying the default bump shader to generate its own binormal/tangent vectors and the normal maps started showing up.

I do have the Tangents & Binormals option selected under the Chicken script, of which I am using R71b.

Ah, didn’t spot that - would explain the issue. I shall look into it latter today and get a fix out asap.

Well, I’ve been sitting on the fix for this problem for about 5 hours now… waiting for sourceforge to fix their dam upload software so I can do an actual Chicken release. At this point I’ve given up on that happening in any reasonable period of time - they said half an hour…

Anyway, I said I would fix the bug before the day is out (One line fix - simply wasn’t passing the ‘make tangents/binormals’ flag the whole way along, and it defaults to false.), so you can download the soon to be new release from http://thaines.net/content/panda3d/chicken_exportR76.zip. It also includes a bunch of texture stuff provided by pro-rsoft - I’ll stick release notes in the Chicken thread when its up correctly on sourceforge rather than just on my site.

Hummm

I guess wasn´t finalized yet. When i press L no light effect and when i press P i see only the normal map in texture.
Well … relax a little then :slight_smile:

Thanx :wink:

Dam - I didn’t look too closely when testing, well, was checking the contents of the file really. Looking at it my fix is correct, the problem is the new texture handling code - it is now exporting the material as a ‘REPLACE’ texture rather than a ‘MODULATE’ texture, not sure why that kills the lighting however - it really shouldn’t. I am going to have to bounce this off of pro-rsoft, as he wrote that part of the Chicken code, and also knows the shader generator - my guess is he flipped it to correct behaviour… which is only valid for the cvs build. (There are a lot of changes to the shader generator for 1.7.0.) For the interim just change the texture mode from ‘mix’ to ‘multiply’ in blender, alternatively in the chicken export file there is a variable ‘MAP_MIX_TO_MODULATE’ on line 73 - change it to True and the behaviour reverts to its old mode, which I just confirmed works.

Hey dude

Really … if i change colormap to multiply it work´s! (sounds Apache but doesn´t ) :laughing:
Also light effect (L) return too. I didn´t test in my code (i´m on work … again :cry: ) but sounds fine.

Besides cannot forget to tell the users the change in procedures (if this is new´s final Chicken version ).

:laughing: :laughing: :laughing:
Hapilly Thanx

Sires

This can be small-talk … but with this new exporter my scenes normalmapped have a sensible increase in performance (up framerate). This is a side effect of change the texture mode from Mix to Multiply or something change internally?

Impressive. Maybe i losing my mind but things going very better now.
:open_mouth:

lethe, I made it map to Replace as performance optimization, when there was no previous texture. With the shader generator it’s no big deal, but without the shader generator, I think it may kill lighting because then the lighting is applied before the textures (yuck.)
Sorry, I did not realize this. I’ve just checked in a fix to chicken.

For 1.6.2 it appears to kill lighting with the shading generator as well. I think that your code should work, but as it evidently doesn’t then, yeah, the change is required. Thanks on committing it - it was the exact change I imagined being required:-) I just prefer to understand bugs before I squash them! And whilst I understand what your saying - lighting is effectively coming in via the vertices and being multiplied by the texture, I have to wonder then how mix mode works - I don’t see how the mixed in texture could be lit.

Anyway, I’ll go do a chicken release in a short while - their status says they finally fixed last nights issues!

Yeah, I guess the absolute correct way would be to let Chicken create a new texture stage at the end without a texture that multiplies the result by the lighting info. I think that’s how blender does it.

Ok, just to finalise this thread - a new release of Chicken is now on the sourceforge site. The temporary fix I gave above of switching from mix to multiply is no longer needed - the default mix mode now works fine.