- Home /
[Closed]2D image as an object
is that possible to add 2D PNG image into the game? i try to do it, but i must add it to material, and attach it to any 3dobject or Plane if i want it to appear, but what i want is
i draw a tree on this image, save it as PNG, and i want it appear on Unity3d as a tree alone, without white background.. is that possible? because i watch on youtube, this man just add tree without white background but i dont know how to do it.. [this is the link][1]
see when he add this wooden fench, tree, and snowman, anybody could teach me how to do it? [1]: http://www.youtube.com/watch?v=9Vl166fVe8E
Answer by TonyLi · Dec 03, 2013 at 06:30 PM
Make the background transparent, not white, in your paint program. Then use a transparent shader in Unity.
To Expand on @TonyLi's answer, you need to use an import setting in Unity that has an alpha channel. Only a fraction of the shaders support transparency. Start with Unlit/Transparent for the material you create.
emm, yeah i make it with photoshop and blank background, only a tree image, no background and save it as PNG file.,, and how do i use transparent shader in Unity @TonyLi
@robertbu ermmm, i'm quite dont understand how to do that, u mean i should use import option, and not just drag it to my project overview?
Here's one way:
Drag the image into your project.
Add a Quad to your scene.
Drag the image onto the Quad.
Select the Quad and change the material's shader to Unlit/Transparent.
You didn't specify whether this is for a 2D or 3D game, for a billboard, or what. You could also use a GUITexture, depending on your needs. And if it's 3D you might need to add a script to make it always face the camera, maybe something like this.
Drag the image into your progject
Select your texture and in the inspector set Texture Type to "Advanced," turn off "Generate $$anonymous$$ip $$anonymous$$aps" and Set Format to RGBA 32 bit. Other setting will work, but this is a place to start.
Create a new material and select Unlit/Transparent for the shader.
Add your texture to the material.
Drag and drop your material onto your Quad or Plane.
Answer by JSierraAKAMC · Dec 03, 2013 at 06:45 PM
If you are using Microsoft Paint, it will not work. Instead, use GIMP or Paint.NET. Then, you can set the background to be transparent, as it is not available in Microsoft Paint.
yeah, i use photoshop and delete the background, so there is no background and i save the image as PNG, then after that, what should i do?
Answer by ovi786 · May 05, 2014 at 05:06 AM
If you are using photoshop .Make the image background transparent and then Save the image as photoshop format and then attach it to your unity quad object.
Your answer
![](https://koobas.hobune.stream/wayback/20220613123327im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Adjust overlay position for different resolutions 0 Answers
How to load a BMP file in binary? 2 Answers
Adjust Image to Plane? 1 Answer