Jump to content

Fur material as realistic grass


Pab144
 Share

Recommended Posts

Wassup Guys,

Is there a way to add ambient texture to the Fur Material?

Reasons: I'm using the Fur material to generate realistic looking grass (see pic) and it's all kinds of awesome. I was hoping however that there was a way to add Ambient Textures to this material so I could use baked shadows.

Please help Babylon Kenobi, you're my only hope.

grass.jpg

Link to comment
Share on other sites

Okay so I found a viable solutions.

Complete Map(Diffuse and Ambient get baked into one map) plus a high number for the furDensity parameter.

Code below.

            var grass = scene.getMeshByName("site-grass-1");
            
            var grassMaterial = new BABYLON.FurMaterial("grass", scene);
            grassMaterial.furLength = 2;
            grassMaterial.furAngle = 0;
            grassMaterial.furColor = new BABYLON.Color3(1,1,1);
            grassMaterial.diffuseTexture = new BABYLON.Texture("assets/Alberino/site-grass-complete.jpg", scene); //COMPLETE MAP RENDERED IN VRAY BUT BLENDER OR SCANLINE WILL DO TOO
            grassMaterial.diffuseTexture.coordinatesIndex = 1; //THIS PART IS KEY DEPENDING ON WHICH CHANNEL YOU BAKED YOUR MAP INTO
            grassMaterial.furTexture = BABYLON.FurMaterial.GenerateTexture("furTexture", scene);
            grassMaterial.furSpacing = 6;
            grassMaterial.furDensity = 250; //THIS IS WHERE THE MAGIC HAPPENS, THE HIGHER THIS NUMBER THE MORE GRASS BLADES
            grassMaterial.furSpeed = 800;
            grassMaterial.furGravity = new BABYLON.Vector3(0, -1, 0);
            
            grass.material = grassMaterial;
            
            var quality = 30;
            
            var shells = BABYLON.FurMaterial.FurifyMesh(grass, quality);

 

See pic for final result.

PS: some Photoshop editing might be required to get difference between light/dark areas of the complete map just right.

grass-2.jpg

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...