Home › Forums › Programming › texture color difference
- This topic has 3 replies, 2 voices, and was last updated 3 years, 5 months ago by feiyanlei.
-
AuthorPosts
-
2021-07-02 at 7:53 am #42468feiyanleiCustomer
Hello, due to the project reasons, some places have to use code to write, when I use code to add a map to the model, the effect of the map display is different from the map in Blender, what is the reason?
const loader = new v3d.TextureLoader(); loader.load( url, function( texture ){ texture.flipY = false; mesh.material = new v3d.MeshBasicMaterial({ map: texture }) } )
Attachments:
You must be logged in to view attached files.2021-07-03 at 12:23 am #42498xeonCustomerHi there,
As I am sure you are aware there are differences between EEVEE and Verge3D that we are always battling.In most cases, its the material, lighting or both.
without seeing your materials I am guessing you are using a Principle BSDF since its the most compatible material between the two.
Within Blender set all your Principle BSDF settings to 0. You can leave Emission and Alpha set to 1.0 and see if that doesn’t solve the problem.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2021-07-05 at 4:13 pm #42547xeonCustomerHi Feiyanlei,
I re-read your question and realized I did not answer it completely.MeshBasicMaterial is not affected by light and Blender Materials by default are. So there will be a drastic difference between the two.
https://threejsfundamentals.org/threejs/lessons/threejs-materials.html
If you are wanting the blender result via code, you will need to add a bit of complexity to your code to layer up a material. Black background, alpha masked text color and then add emissive properties to the color. Depending on how glossy you want the screen you may need to change the baseMeshMaterial to another material form to get the desired effect. BaseMeshMaterial is 100% flat so it looks more cartoon like and I believe would not match the your background scene.
Hope this helps.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2021-07-07 at 9:23 am #42594feiyanleiCustomerHi Xeon,
Thank you very much for your reply, because my problem is not described in the order, maybe your answer is different from what I want, I also use Emission in Blender.
But I’ve solved that problem, just add this code to add the following code when loading the text.
texture.encoding = v3d.sRGBEncoding;
Here is a complete code。
const loader = new v3d.TextureLoader(); loader.load( url, function( texture ){ texture.encoding = v3d.sRGBEncoding; texture.flipY = false; mesh.material = new v3d.MeshBasicMaterial({ map: texture }) } )
-
AuthorPosts
- You must be logged in to reply to this topic.