Messages in this topic - RSS

Home ? Tips & Tricks ? TRANSPARENT MATERIALS IN FBX FILES

pages: 1 2 | Please log in or register, then complete your details to create a post.
09/10/2016 07:07:14

PatMarrNCMuvizu mogul
PatMarrNC
Posts: 1738
This is one of those topics that has driven many of us to the brink of insanity... and thanks to IKES, I may have new information for that will help some of those who haven't been able to get transparent material (such as glass) into their FBX files.

When I saw that IKES had uploaded cars with glass, I asked him how he did it. He told me step by step... and I followed his instructions... but it didn't work! So Ikes sent me an OBJ and its MTL file to compare with mine,

Much to my surprise, I discovered that my modeling program stripped out the information needed to get the transparency working!! I manually entered the missing information into my MTL file, converted it to FBX, and whattaya know?? It had transparency!!

After reading some threads and seeing that guys who use Milkshape have a time with this, I discovered that Milkshape does the same thing! It strips out a key part of the material description that allows Colors (not textures, they're handled differently... and Milkshape doesn't strip that out... which is why you can get transparency when using textures)

Anyway, here are two examples of an MTL file... one showing what many of our Modeling programs generates, and then an edited version that actually works:

newmtl blue
Ka 0.8 0.8 0.8
Kd 0 0 1
Ks 0 0 0
Ns 64

newmtl banjo
Ka 0.611765 0.611765 0.611765
Kd 1 1 1
Ks 1 1 1
Ns 0
map_Kd /home/pat/Pictures/BANJO.png


Notice that the blue material (a color) has one less line than the banjo material, which uses a texture file. With a texture file, if there are alpha areas in the texture, the alpha is inherited from the image.

The first material only shows information for Ambient (Ka) Diffuse (Kd) Specular (Ks) and shininess (Ns). For colors, Alpha is declared as a decimal percentage after the letter "d". With that in mind, here's the edited version that works:

newmtl blue
Ka 0.8 0.8 0.8
Kd 0 0 1
Ks 0 0 0
Ns 64
d 0.20
illum 2


Since "d" is a percentage of opacity:
d 0.0 = totally clear
d 1.0 = totally opaque (solid)
d 0.2 = 20% opaque (or 80% clear)

In conclusion.. if you've been having a fit trying to get transparency into your FBX files, start by looking at the MTL file that gets generated along with your OBJ file. If it lacks the "d" parameter, that may be your problem.
edited by PatMarrNC on 09/10/2016
permalink
09/10/2016 15:17:08

ziggy72Muvizu mogulExperimental user
ziggy72
Posts: 1988
Ah! This makes sense - not every program handles the MTL files the same way, but I didn't realise they were actually sabotaging the materials! Congrats on working it out, and thanks again to Ikes for his assistance.
permalink
16/10/2016 18:43:37

PatMarrNCMuvizu mogul
PatMarrNC
Posts: 1738
Once you go down the dark side of manually editing your MTL files, there are lots of things to do. The wavefront OBJ material spec is fairly comprehensive and worth reading.

http://paulbourke.net/dataformats/mtl/

One thing that can make a difference in Muvizu is the illum parameter. I started looking at this because I get weird color artifacts on my models sometimes in Muvizu./ The illum param can help compensate when this happens.

 Illumination:  
syntax = illum # (# is in the range 1-10, defined below)
------------------------------------------------------------------------

0 Color on and Ambient off

1 Color on and Ambient on

2 Highlight on

3 Reflection on and Ray trace on

4 Transparency: Glass on
Reflection: Ray trace on

5 Reflection: Fresnel on and Ray trace on

6 Transparency: Refraction on
Reflection: Fresnel off and Ray trace on

7 Transparency: Refraction on
Reflection: Fresnel on and Ray trace on

8 Reflection on and Ray trace off

9 Transparency: Glass on
Reflection: Ray trace off

10 Casts shadows onto invisible surfaces

--------------------------------------------------

If you start getting light artifacts, try illum 0. It turns off most of the things that make the color deviate from its base color. It also makes it more boring, so experiment.

==========================
edited by PatMarrNC on 16/10/2016
permalink
18/10/2016 17:26:38

PatMarrNCMuvizu mogul
PatMarrNC
Posts: 1738
another thing that affects color/shadow artifacts on models is whether or not the object is UVMapped. I've noticed that even if an object requires no texture and you just want it to be a solid color that can be changed in the object's parameters, UVmapping it makes a difference in color integrity.

Without UVMapping, color gets applied from one direction.. and in the same sense that a texture gets skewed when you apply it to an object without first UVMapping it, I have to think that color gets distorted too.

Whether that explanation is technically correct is a moot point. UVMapping solid colors seems to help my models. Your mileage may vary... but it's something to look at if you're getting color anomalies.
permalink
23/10/2016 09:13:14

PatMarrNCMuvizu mogul
PatMarrNC
Posts: 1738
I discovered tonight that when you add the d parameter to a .mtl material file, and assign any value to it that is less than 1.0, any FBX made from it will have directable/keyframable opacity! The upshot is that you can make objects fade in and out incrementally instead of just completely disappearing or appearing all at once. Imagine a floating ghostly skull or Cheshire Cat that slowly appears or disappears in a scene!
permalink
23/10/2016 10:05:46

drewiMuvizu mogulExperimental user
drewi
Posts: 302
Cool great information re mtl edits Pat, thanks to you and Ikes for sharing.
permalink
15/11/2016 01:02:08

RodrisilvaMuvizu mogulExperimental user
Rodrisilva
Posts: 113
Hi guys

After many complaints about Muvizu FBX importing drawbacks I decided to make a rapid tuto about blender model texturing and FBX exporting using transparency (inside same mesh model).
For those who need help or are confused, Blender remains a wonderful free software. Nothing in life will be easy if we do not try harder.

permalink
15/11/2016 01:50:51

urbanlamb
urbanlamb
(Account inactive)
Posts: 1786
Rodrisilva wrote:
Hi guys

After many complaints about Muvizu FBX importing drawbacks I decided to make a rapid tuto about blender model texturing and FBX exporting using transparency (inside same mesh model).
For those who need help or are confused, Blender remains a wonderful free software. Nothing in life will be easy if we do not try harder.



Indeed I just made something (i have not been using muvizu for awhile it would not install on my system for some reason, but I tried tried again and it worked this time) and it worked flawlessly. I was starting to think that something had broken in the fbx export process in blender, but indeed it actually worked better then previously.

I hope your tutorial helps. I dont know if people dont understand me or what, but I have tried explaining this and it seemed not to help.
edited by urbanlamb on 15/11/2016
permalink
15/11/2016 20:10:54

ziggy72Muvizu mogulExperimental user
ziggy72
Posts: 1988
That's a great little video Rodrisilva, but the model at the end is single sided - how can you avoid that?
permalink
15/11/2016 22:44:06

RodrisilvaMuvizu mogulExperimental user
Rodrisilva
Posts: 113
ziggy72 wrote:
That's a great little video Rodrisilva, but the model at the end is single sided - how can you avoid that?


One way is to duplicate mesh and flip normals direction on second mesh. Not necessariy all model but only transparent area car section.

You know, I had to choose a simple model for this tuto, not the ideal one.
permalink
15/11/2016 23:02:52

primaveranz
primaveranz
Posts: 520
I checked with Digimania and Voxelise offers no solution to the Transparency issue.
permalink
15/11/2016 23:35:17

ziggy72Muvizu mogulExperimental user
ziggy72
Posts: 1988
Rodrisilva wrote:
ziggy72 wrote:
That's a great little video Rodrisilva, but the model at the end is single sided - how can you avoid that?


One way is to duplicate mesh and flip normals direction on second mesh. Not necessariy all model but only transparent area car section.

You know, I had to choose a simple model for this tuto, not the ideal one.

Makes sense, thanks
permalink
16/11/2016 05:25:07

primaveranz
primaveranz
Posts: 520
For milkshape users.
Thanks to Pat and Rodrisilva, I now have a workflow from Milkshape into Muvizu with transparencies.
I create a model with separate transparent and opaque materials.
Export to Wavefront OBJ format into a folder.
Edit the .MTL file as described by Pat above.
Import the OBJ into Blender (DON"T PANIC!)
Export from Blender as FBX.
Import to Muvizu.
Et voila!

This way if you don't have the inclination to learn Blender all you use it for is to export the FBX. Not sure why the broken link icon is showing below, if you click it you should see the image.

edited by primaveranz on 16/11/2016
permalink
16/11/2016 09:01:20

primaveranz
primaveranz
Posts: 520
So apparently you can't link to pics on a Google drive from the forum and see a preview?

https://drive.google.com/file/d/0Bz7oh4SWxJEFLUgtRjE4LS1SOTQ/view
permalink
16/11/2016 11:52:47

PatMarrNCMuvizu mogul
PatMarrNC
Posts: 1738
Primaveranz! You got it working!! WOO HOO! That's awesome! I love it when people are free to share ideas, everybody benefits!

Regarding the addition of photos to forum messages: This is one of the few forums that doesn't require you to link to a URL... you can simply copy-paste photos directly into the message. So if you have a way to open the graphics and hilite-copy it, then its just a matter of clicking inside the message and PASTE!

PS... nice looking model! Great texturing !

------------------------------------------------
edited by PatMarrNC on 16/11/2016
permalink
16/11/2016 17:44:02

primaveranz
primaveranz
Posts: 520
Couldn't have done it without you two guys
It makes life a hell of a lot easier for me as I a very comfortable with Milkshape having used it for years and I don't have the time to learn Blender (again!) - I'd rather be making movies.

I tried pasting the two jpgs into this post but no luck again
edited by primaveranz on 16/11/2016
edited by primaveranz on 16/11/2016
permalink
17/11/2016 00:55:40

PatMarrNCMuvizu mogul
PatMarrNC
Posts: 1738
how did you copy it? It doesn't work by copying the file itself, it has to be open in a program like Windows paint, then you click on the image to select it, and CTRL-C to copy...

then in your forum message, CTRL-V to paste, and you get an image as follows:

permalink
17/11/2016 02:17:12

primaveranz
primaveranz
Posts: 520
I opened each of them in Paint.Net, selected all, copied and then pasted into the message. Nothing happened though.
I tried with a couple of different browsers as well, PNGs as well as JPGs and I have just tried again in this post on my work PC with a different picture - same result.
Maybe only the favoured few Moguls can paste pictures
edited by primaveranz on 17/11/2016
permalink
17/11/2016 14:32:14

PatMarrNCMuvizu mogul
PatMarrNC
Posts: 1738
interesting. Anybody else have any ideas on this? All of us together are smarter than any of us individually...somebody out there must know what key steps are required to get a photo into a forum message.

Maybe what messed it up was SELECT ALL. Did you try just clicking to hilight one image, then use CTRL-C (Not CTRL-A) to copy it?
permalink
17/11/2016 14:45:06

fazz68
fazz68
(Account inactive)
Posts: 763
how to get a photo/picture into the forum.. upload it to imgur or photobucket or whatever host you use. copy the url or whatever code they provide for that pic and paste it in your post.

in the case of imgur it would be this one...


edited by fazz68 on 17/11/2016
permalink
pages: 1 2 | Please log in or register, then complete your details to create a post.

Home ? Tips & Tricks ? TRANSPARENT MATERIALS IN FBX FILES