Jump to content

gLTF Exporter Fur Material issue


Pab144
 Share

Recommended Posts

Hey there Babylonians,

I'm having an issue with the gLTF exporter for 3dsMax 2017 and FUR MATERIAL, It would seem that when I add the FUR MATERIAL to the mesh exported using gLTF the faces get flipped or something. I tried exporting the same geometry using just the .babylon file format and it worked nicely picture below.

grass.thumb.jpg.299310c02c43e73692f2eb323262099d.jpg

However when I export with .gltf format it looks like this.

grass-gltf.thumb.jpg.1cd7213db092f21023880b6846120ce7.jpg

I've tried flipping the faces inside of 3dsmax but so far no luck. Also I've noticed that the gltf exporter rotated my mesh 180 degrees on the y-axis for some reason.

Any help or advice would be of great help.

Regards, 

Link to comment
Share on other sites

I did some "testing" with 3dsmax primitive shapes to see if the issue is was just a geometry problem with my mesh, bu the error came up again.

grass-gltf-primitives.thumb.jpg.d5c92d0bfaca625097cffccf6dbda8fd.jpg

I'm trying to use BJS for architectural presentations and so far it's been real great. I'm trying to build the scenes and export them from 3dsmax using .gltf to use pbr materials for better realistic results but my solution for generating realistic grass doesn't export well. Here's a pic of the scene using .babylon file format and Standard Materials.

house-test.thumb.jpg.f06a63932d48f0dc556aee7f9bb317ec.jpg

Any help or guidance would be greatly appreciated.

Link to comment
Share on other sites

Hi @Pab144

You are right there is a 180 degrees on the y-axis rotation on the glTF export. It is due to the change of the coordinate system (from 3DS Max to Babylon and from Babylon to glTF).
Plus changing a mesh material doesn't work (even if it's not a fur one). I suspect it is related to the uv...

I created a issue on github. Here is the link https://github.com/BabylonJS/Exporters/issues/276

As soon as I found something, I will tell you.

Link to comment
Share on other sites

Hi @Pab144

Did you see the answer of bghgary on github? He said that you have to set the material sideOrientation to ClockWiseSideOrientation. So in your code you should add something like this:

grass.material = grassMaterial;
grass.sideOrientation = BABYLON.Material.ClockWiseSideOrientation;

var quality = 30;
var shells = BABYLON.FurMaterial.FurifyMesh(grass, quality);
for (var i = 0; i < shells.length; i++) {
    shells[i].material.sideOrientation = BABYLON.Material.ClockWiseSideOrientation;
}

 

Link to comment
Share on other sites

Hi @Pab144

As I was unable to reproduce the bug in the playground, I though that it was related to some dependencies. So I replace the scripts in the index.html

  <script type="text/javascript" src="babylon/babylon.custom.js"></script>
  <script type="text/javascript" src="babylon/babylon.inspector.bundle.js"></script>
  <script type="text/javascript" src="babylon/babylon.furMaterial.min.js"></script>

by

  <script src="https://preview.babylonjs.com/babylon.js"></script>
  <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
  <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
  <script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>

And it works :)

Can you tell me if it's 0k for you?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...