Prevent Stretching of Image on Material Assigned to a 3D Plane?
I have a Unity 3D app with a bunch of materials and different jpegs assigned to them. I also have a plane with a material assigned to it. Through a C# script, I switch out the material assigned to it. The effect is that my app shows an image, one at a time and the image changes after a period of time and shows another one.
The issue I have is that depending on the shape of the jpeg file, my image displayed on my plane gets skewed. So if my plane is square, but my image file is rectangle, then the tops and bottoms of my image get stretched to fill out the plane. I don't want this. I want the image displayed just once without any stretching. How do I do this?
This is what I am currently doing:
Create a 3D Plane by: Game Object -> 3D -> Plane.
Add it to the scene, and scale it appropriately
Create -> Material. Done 10 times
Drag 10 jpgs into editor
Click Material. Click Albedo. Choose jpeg file. Done 10 times, one for each material/jpg
Drag one of the Materials onto plane
Add the following code to script, which happens at different events in time: Renderer myRenderer = myPlane.GetComponent(); myRenderer.material = aDifferentMaterial;
What settings should I change to prevent the stretching?
THANKS!!!
Your answer
Follow this Question
Related Questions
Apply texture/materials without stretching them according to the surfaces of the 3D structure 0 Answers
Looking for help with creating a gold texture/reflection for mobile games 0 Answers
Textures, Materials, Meshs and Maps? 1 Answer
HDRP, terrain and layer count, 0 Answers
Materials messed up on mobile? 1 Answer