Jump to content

Question about textures


alconmilenario
 Share

Recommended Posts

Hello! I have a project with a coffee cup, which have a little plane over it where people can insert a photo. At the attached are some examples. 

The problem is: when a photo is in that space, and I move inside the world, or the camera is turned... The picture turns a little transparent, and the color of the cup turn  overhead the photo. I would like, that the picture would be the most important, and would have as much definition as possible. 
As nearest the camera is, better visibiliy of the pictures, without the cup color interruption. 

I am sure that he layer with the picture have a material with alpha of 1. And the color of the cup is made with diffuseColor. 

With the attached pictures I am sure that it would be more understandable.

Thanks in advance. I am turning crazy with that problem.

zoom in.JPG

zoom out.JPG

near zoom.JPG

middle zoom.JPG

out zoom.JPG

Link to comment
Share on other sites

7 hours ago, Deltakosh said:

Hello nice project :)

Just set your plane.material.zOffset = 1 and this should fix your depth fighting issue

Thanks a lot, but it was not resolve my problem. I have put in the cup mesh a zOffset=1 and in the plane with the picture a zOffset=-1. I have read about it in that example: http://www.babylonjs-playground.com/#1NYKLE#4

I have tested with cup mesh with a zOffset of 0 and with the picture to 1, and the result is exactly the same. 

Any idea what is happening? 

 

 

Link to comment
Share on other sites

8 hours ago, Deltakosh said:

You can increase zOffset

 

In the meantime, you can also reproduce the issue in the playground. This will be easier to help you then

Hello!! I have solved it changing the values of the camera. It was the main problem. At first I had a cam.fov = 0.01, and I supposed that it was a very small range. Then I have put more, and apparently it is solved. I discover it when I was developing a playground to show the code. I don't know how it works, but testing with some combinations of numbers of cam.fov and cam.radius it is solved.

Thanks for your time!!

Link to comment
Share on other sites

Can someone explain why the fov being set low would cause clipping like this?  I've seen other odd happenings with different 3D engines when you set the near clip of the camera to a low value, but what's the reason for this? Can someone link me to the script that would deal with this function with the camera.

Link to comment
Share on other sites

3 minutes ago, Pryme8 said:

Can someone explain why the fov being set low would cause clipping like this?  I've seen other odd happenings with different 3D engines when you set the near clip of the camera to a low value, but what's the reason for this? Can someone link me to the script that would deal with this function with the camera.

Orrrhh mang. U need to look at the source on what you are trying to do.  And test against something vanilla to determine that.  I would think with a  low FOV everything would get sandwiched....

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