ModelMod icon indicating copy to clipboard operation
ModelMod copied to clipboard

Lighting: Generate binormals/tangents correctly

Open jmquigs opened this issue 9 years ago • 4 comments

These are basically just hardcoded and it results in dynamic lighting being off (sometimes way off) depending on the model.

Solution is to apply math sledgehammer: http://stackoverflow.com/questions/5255806/how-to-calculate-tangent-and-binormal

jmquigs avatar Mar 30 '16 17:03 jmquigs

It turns out blender can generate these, so I just need to export and use them.

jmquigs avatar Mar 02 '17 02:03 jmquigs

Thank you for the awesome work! Is there a way to update the script that fixes this for Blender 2.8x and above? I'm very much not familiar with 2.79 or python.

s8rc47 avatar Sep 09 '21 00:09 s8rc47

This remains unfixed in all versions. I don't recall the details since it was a while ago but I believe my experimental fix in the above commit was not successful.

The blender scripts are also locked to version 2.79 at the moment. They would need to be manually ported to 2.8+. The MMObj scripts were originally based on the blender's own obj scripts, so the MMObj specific changes would need to be merged in using the updated obj scripts from 2.8+. It is probably a big job and I hate python so I don't have any plans to do it myself.

jmquigs avatar Sep 09 '21 00:09 jmquigs

Thank you for the reply. I stumbled through 2.79 and was able to get something workable by editing a duplicate model and using a data transfer modifier. The normals aren't perfect but they seem better than the original snapshot.

Too bad I discovered ModelMod so late. It's fun!

s8rc47 avatar Sep 09 '21 05:09 s8rc47