blender lighting/ face problem

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

blender lighting/ face problem

Post by biteme »

Hiya I this may be a bug in the exporter or a heads up don't know wich.

As you can see in the antenna there are a bunch of faces that are lite incorrectly these are faces that I have eighter mirrored or rotated in the uv editor. I was woundering if this was an export problem or is somthing I need to say away from?
Last edited by biteme on Mon May 01, 2006 4:57 am, edited 1 time in total.
scotths
Kobold
Posts: 26
Joined: Sat Mar 18, 2006 2:43 am
Location: Albany, CA
Contact:

Post by scotths »

I'm not sure if I can tell what's wrong, but the thing I usually try when things look weird is to see if some normals ar flipped the wrong direction. Can you zoom in on the problem area?

Scott
Newfound Room -- My new open content site.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Re: blender lighting/ face problem

Post by reimpell »

Do you have the same problem if you display the model with blender's internal game engine?
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme »

The normals are correct when I rotate the faces back everythings fine.

whats wrong scotths, in the screen shot is there should be specular highlight in roughly the middle of the antenna the highlights around the edge sould not be there and like I said its fine when I put them back the way they were after the intial mapping before I started mirrioring the texture.

reimpell I have no idea how to work the blender game engine were using ogre so I never realylooked at the blender game engine. Is there any other info i can give you that would help?


The model uses nfz'n fxmap shader and the normal map is derived from the texture using nvidias normal map plugins for photoshop.
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

Use the P key inside blender to view the model with blender's game engine. You can leave game engine mode with the ESC key. Anyway, the exporter does not assume a certain orientation of the faces, but I'm not aware of if the fxmap shader does so.
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme »

reimpell wrote:Use the P key inside blender to view the model with blender's game engine. You can leave game engine mode with the ESC key. Anyway, the exporter does not assume a certain orientation of the faces, but I'm not aware of if the fxmap shader does so.

I tryed the game engine but the model is displayed with ambient lightig full blast so the problem isn't there.
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme »

reimpell wrote: Anyway, the exporter does not assume a certain orientation of the faces, but I'm not aware of if the fxmap shader does so.

I a bit confused but that responce, dose it mean that you don't belive it's not an export problem? Is it just that Im using a shader and can not mirror or rotate faces?
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

biteme wrote:dose it mean that you don't belive it's not an export problem?
Yes, I would look at the shader first. Can you reproduce the problem with a single triangle as mesh?
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme »

Image





Image


As you can see I have been working on this problem. I can't pin down what causes this but I can tell you how I got from the first screenshot wich the lighting is all screwed up (the white v shaped highlight is incorrect) and the second screenshot where the lighting is correct and you can see that the textures are orientated exactly the same in both pictures.

I took a cube and extruted it then I opened up the uv editor assigned the texture and used the standred uv unwraper and scaled the uvs over part of the texture.

I then mirrored the top right, top left, and bottom right faces (each square is a face) to the rusult in the fist screen shot and the messed up lighting.

I then selected the lower right face and copied the texture and uv from the bottom left face, rotated the uvs in the uv editor 90 degrees and mirrored the face in the uv editor in the x and y directions this gave me the oritation of the texture in that face i had in the first place.

I then copied the uv and texture for the upper right face from the upper left face, in the uv editor I rotated the face 90 degrees and rotated the uvs in the 3d window with the r key and mirrored the face in the y direction in the uv editor this once again gave me the original position of the texture on the face.

All that produced the exact same texture lay out with the correct lighting.

Now this whole thing is rendered with nfz fx shader and the problem does not show it self in blenders rendering.

As far as I know the shader uses vertex positons normals and tangents for lighting so I guessing the vertex normals are getting flipped somewhere along the way between blender the exporter and the xml tools.

I realize that this may make no sence I certenaly doesn't to me. The 2 main things are

1 the 90 degree rotations in the uv editor seem to make the difference.

2 the problem has to be in the normal or position data as its a lighting problem in the shader. (this is a total guess)

This problem is driveing me nuts (ok nutter) please help or give me some direction on how to solve this as I realy don't want to spend $3500 on 3ds and I can't use anthing I've made in blender because of this.
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme »

After spending 2 weeks trying to figure out what's causing this problem problem I have given up. while I can't seem to pin it down I did duplacate the problem in 3ds by uv mapping the model then applying smothing, if I apply the smothing first then uv map it's perfect.

If someone is willing to look at this problem I am more than will to supply the models, material, textures, shaders that I used to help find a solution.

Learnig 3ds is going to put me behind big time as Im going to have re map all my models in 3ds so If there's anything I can do to help find a solution let me know as I can't be the only one with this problem.
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme »

A little more info on this.

I ran into the same problem in 3ds and fixed it by selecting all the faces in the uvw unwrap modifiyer >> edit uv map window and using detatch edge verticies in the rc menu.

I was woundering if there is a way to do the same thing in blender?
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme »

wow Iv'e been on a wild roller coster ride with this problem and have discovered that every thing I posted is perty much garbage.....sucks to be a noob :oops:

I have discovered that the problem is because I am tieling and mirroring the normal maps and in doing so the tangents that are created are not allways correct and when using smoothing groups the problem is tons worse.

Has anyone found a work around for this? I am assuming the exporters are responable for generating the tangents or am I wrong on that too :shock:
biteme
Halfling
Posts: 70
Joined: Fri Mar 11, 2005 12:49 am

Post by biteme »

Forgot to mention I did sovle the problem by changing the normal map normals to object space in the pixel shader but it's rather expencive. It droped the frame rate of a 15k model by 200 fps at 2048*1200 res in our model viewer.
Post Reply