Jump to content

Issue with specular & backfaces?


Aerion
 Share

Recommended Posts

Is there any reason why the back ( face ) of my leaf texture is shining with specular when I turned off specular for the leaf texture?

I circled in the color black, the leaf that is shining with specular white that should be off.

As you can see, the front ( face ) of the leaves are fine.

Here is the Source Code : 

	    meshTask.onSuccess = function ( task ) 
	    {
	        task.loadedMeshes [ 0 ].position = BABYLON.Vector3.Zero ( );
	            // Decrease specular or what is called shine in the thread
	                // Mat 94 - Bark Texture
	                    scene.getMaterialByName ( "Mat94" ).specularColor = BABYLON.Color3.Black ( );
	                // Mat 910 - Leaf Texture
	            // Disable culling or what is called seeing half the leaves in the thread
	        scene.getMaterialByName ( "Mat910" ).backFaceCulling = false; 
	    }

Thanks!

backface_specular_problem.png

Link to comment
Share on other sites

Hi,

As always, it is much better to actually see it that to see a picture of it.

Check your emissive texture and color, try to use the disableLighting flag and see if there is any effect. Also - you are changing the specular color of the bark, but not of the leaves. Your circle is around a leaf. Maybe try playing with the leaves-material?

But again - reproduce it on the playground if you want a quicker solution.

Link to comment
Share on other sites

@RaananW

http://babylontesting.epizy.com/loadentity/

http://babylontesting.epizy.com/loadentity/models/deciduous/01/deciduous01/deciduous01.mtl

	    meshTask.onSuccess = function ( task ) 
	    {
	        task.loadedMeshes [ 0 ].position = BABYLON.Vector3.Zero ( );
	            // Decrease specular or what is called shine in the thread
	                // Mat 94 - Bark Texture
	                    scene.getMaterialByName ( "Mat94" ).specularColor = BABYLON.Color3.Black ( );
	                // Mat 910 - Leaf Texture
	            // Disable culling or what is called seeing half the leaves in the thread
	        scene.getMaterialByName ( "Mat910" ).backFaceCulling = false; 
	    }

English_Oak_diffuse.png

Link to comment
Share on other sites

You have the diffuse texture defined as specularTexture as well. You can either set the specularPower to be a very hight number, disable the lighting (as suggested before) or simply remove the specularTexture and see what happens.

Make sure your specularColor is set on the right material (as also suggested).

Link to comment
Share on other sites

@jerome i just did, but to no avail...

http://babylontesting.epizy.com/loadentity/

	    meshTask.onSuccess = function ( task ) 
	    {
	        task.loadedMeshes [ 0 ].position = BABYLON.Vector3.Zero ( );
	            // Decrease specular or what is called shine in the thread
	                // Mat 94 - Bark Texture
	                    scene.getMaterialByName ( "Mat94" ).specularColor = BABYLON.Color3.Black ( );
	                        // Decrease specular or what is called shine in the thread
	                    scene.getMaterialByName ( "Mat910" ).specularColor = BABYLON.Color3.Black ( );
	                // Mat 910 - Leaf Texture
	            // Disable culling or what is called seeing half the leaves in the thread
	        scene.getMaterialByName ( "Mat910" ).backFaceCulling = false; 
    }

Link to comment
Share on other sites

You know, I test each and every one of my suggestions before posting them.

You have a specularTexture, that once removed, removes the shininess effect on your leaves.

And, as also suggested in a different thread, disable the offline support, as it prevents you from actually seeing changes made in your resources. Set the offline mode when you are happy with the result.

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