how to fix not having filter mode in Unity - unity3d

Hello so basically I want to fix my pixel art in unity and what i have found is that i should change the filter mode to point but the thing is I don't seem to have filter mode ( I'm new to Unity ) if u can help would be amazing ;-;

To properly setup your pixelart assets in Unity, you should change some default settings in the import asset phase.
In your project window, click the Texture you just imported and look at the Inspector Panel.
You need to change these two settings:
Filter Mode to Point (no filter)
Compression to None
You can also consider to change Pixel Per Unit setting, which basically is, as the tooltip says, how many pixels in the sprite correspond to one unit in the world.
This setting can help you to easily understand the correspondence between the dimensions of your texture/sprite and the units of Unity (it's an habit to consider 1 Unity Unit = 1 meter).
Of course, if you do this, you should chose a standard Pixel Per Unit value and use it in every texture/sprite you import.

This is found in the Texture Inspector.
Click on your texture asset in the project window.
In the inspector you should see all the options for your texture.
You can also do this from code
public Texture myTexture;
...
myTexture.filterMode = FilterMode.Point;

Related

How do i make a 3d game pixel perfect? so that there is no anti aliasing or other filtering applied

This is what the game looks like in the 'game' window in unity, which is what it should look like https://ibb.co/xjst4vw achieved by removing all lighting including ambient lighting.
And this is what it looks once built https://ibb.co/4RcbMv8
Why is there a haze in the border between colors? How do I get it to be pixel perfect?
The aspect ratio of the in editor display is 160x144
I have change the game resolution by going to >edit >project setting >player and changing the height and width to the right size
The camera is also passing to a render texture which is of the right size, with the filter mode set to point.
I cant figure out what is causing this. to my knowledge All lighting is turned off. It looks like some up scaling error or maybe some sort of anti-aliasing effect which has also been turned off everywhere i could find.
Does anyone have an idea about what might be causing this? thanks.
There is postprocessing window in unity where you can specify such things like antyaliasing and so on. I think that this will make your game pixel perfect.
Found the answer to my own question the resolution in the >edit >project setting >player >resolution and presentation need to be as high res as it can be so in my case for a 1920x1080 screen it should 1120,1008 which is 160x144 scaled up by 7.
Then send data from you're main camera to a render texture that is set to the resolution you want (in my case 160x144) and create UI canvas that takes up the whole screen and a raw image as a child. Then put the render texture you created in the texture.

UI is shown too small in final (built) game

I'm a newbie to Unity and am learning. I've made my first game which is a simple platformer, along with a main menu. The game also has some text GUI elements. When I run it in Unity's built-in player, the GUI looks fine, but when I build the project and run the game using the .exe, the UI is scaled down.
I'm attaching some screenshots below to clarify this.
(As seen in Unity player)
(As seen in game)
Also, the game UI also looks scaled down:
(As seen in player)
(As seen in game)
I want the in-game UI to be exactly like the one seen in the Unity player.
How do I fix this?
The Canvas can be set to scale with different settings if you want it to be accurate you should choose:
-Scale With Screen Size
Using the Scale With Screen Size mode, positions and sizes can be specified according to the pixels of a specified reference resolution. If the current screen resolution is larger than the reference resolution, the Canvas will keep having only the resolution of the reference resolution, but will scale up in order to fit the screen. If the current screen resolution is smaller than the reference resolution, the Canvas will similarly be scaled down to fit.
1- Go to your Canvas and select the Scale With Screen Size option
2- After that, make sure that the Reference Resolution is the same as the Game Window resolution in your Unity layout, I leave here an example:
As you can see, the resolution set on my Game window is (1024x768) and the reference resolution of the Canvas too.

Unity 2D art is blurry

For some reason, I can't get these tilemaps to come out like they were created in Unity...
The pixel art is imported to Unity from Tiled.
The pixel art in Tiled:
The same pixel art imported to Unity:
Does anyone have any idea how I can fix this?
Thanks in advance!
As requested, the sprite import settings:
Posting my comment as an answer after all.
As I suggested, one way to get rid of blurring is to set the "Filter Mode" of the sprite to "Point (no filter)" instead of "Bilinear" or "Trilinear"
Here you can see the difference between bilinear and point filtering.
If that doesn't help, try messing with the quality settings in the Sprite Import.
Increase the "Max Size" and maybe disable "Compression" or increase the quality of the compression.
Here you can see differences between the different compression qualities, ranging from "Low" over "High" to "None"
You can also try to increase the "Max Size" value for higher quality sprites. It scales the dimensions of your sprite to not exceed the specified value. If your sprite sheet is already smaller than the "Max Value", increasing it will have no effect though.
The next picture shows the differences between Sizes 512, 256, 128 and 64 for a Sprite with dimensions 423 x 467
You can see that sizes above the dimensions won't have any effect, whereas smaller values will scale the sprite down, decreasing its visual quality.
Usually fiddling around with those values should help making your sprites look sharp and not blurred anymore.
EDIT:
As #NikaKasradze pointed out, there are also default quality settings you can try. Go to Edit > Project Settings > Quality
The matrix on top gives you a selection of all current quality levels for the Editor itself as well as all build target platforms. The green tick shows what currently is selected as the default quality. You can also set the "Texture Quality" which defines the overall texture resolution in your project. You can choose between "Full", "Half", "Quarter" and "Eight Res". You should choose "Full Res" for your current default settings.
Considering you already changed the filtering from Bilinear to Point (no filter), the issue may be that Unity compresses your texture by default. This is likely if it is a POT texture (Power of two resolution).
You can override this for individual platforms at the bottom of the texture's import settings. Select RGBA 32 bit if you need the alpha channel (transparency) or RGB 24 bit if you don't, to get your texture uncompressed.
And don't forget hitting that Apply-button! ;)
If this doesn't help, could you post a picture of your import settings?
Also, what data type is your image?
EDIT:
After the import settings screenshot has been added, it seems to me the issue lies in the SpriteMode settings.
As far as I understand, the image used is a Spritesheet in form of a tilemap. Therefore the SpriteMode should be set to Multiple.
You can then click on the Sprite Editor button and cut the sheet into individual sprites using the Slice function (now separate, as of Unity 5.6).
You probably want to use the Grid - By Cell Size method, which is basically how this is handled inside Tiled.
You also want to adjust your Pixels Per Unit setting to match the resolution of your tiles (for pixel-perfect results).
I had some issues with blurry sprites and I was able to fix it by changing the resolution of my sprites in an image editing software. The resolution was 576x352 and I changed it to 512x512 and that fixed it. I think its best for Unity that images are square and have a resolution that is a power of 2 as often as possible (for example 512 = 2 ^ 9).
Make sure you disabled Mip Maps:
http://prntscr.com/eup3hd
After literally hours of tinkering, the only solution I could come to was to open photoshop and export the tilemap at 4000% its original size.
There is still some minor blurring if I zoom in but at least it isn't as bad as I demoed in my question.
I have tried everyone's answers here to no avail, I am left with the conclusion that it must be a Tiled2Unity problem (despite it never doing this before)
I will update this post if I find a solution...

Black 3D Models - Unity3D

I just recently started using Unity3D, and have imported this object from Sketchfab. When I imported it, it provided all the necessary textures and meshes, but it's all black as shown in the images below. It's the same case for any other object I try to add from the asset store. I've tried to fiddle with the light source, but that doesn't seem to work. Thank you in advance.
Edit: This is what my mesh properties looks like. I have selected "pearl_body" and it's still all black.
You need to expand your model in the Hierarchy(left panel) view untill you will see Mesh Renderer component in the Inspector(right panel). Then you will be able to set the material. Probably you will need replace lambert45G in the material view with BaseTexture.
That should fix the problem.
You can read more about materials here, and about mesh renderers.
I had the same problem and found a solution. Not sure if it will work in your particular case, but here it goes:
I had a model that worked fine in unity until I rigged it, then it looked black. What caused this was that I applied a Smooth modifier after the Skin modifier. I solved it by:
Saving the Skin modifier info by clicking on "Save" at the Advanced tab.
Reset Xform / convert to editable poly / smooth modifier (needed in my case as I forgot to use it when the model was finished, before rigging)
Convert to edit poly again.
Apply skin and load the previously saved skin file.
That's all. Cheers!

Unity 3D anti aliasing not working?

Anti aliasing does not seem to be working with the free version of Unity. I've created a very simple project with a cube, camera and light to demonstrate this.
Anti aliasing is set in the settings:
Edit->Project Settings->Quality
The project is built as a web player and the resulting cube is very jagged with no anti aliasing.
Here's a link to an image of the quality settings for the project and the cube's jagged lines that's produced in my web browser that I'm using here, it's the same with Chrome and IE:
And here's a link to the Unity 3D web app itself:
http://moderncoder.byethost15.com/Unity3DCube/
It seems that anti aliasing is available in the free version so what could the story be with this?
Quality Settings
SWITCH TO SCRIPTING
Unity allows you to set the level of graphical quality it will attempt to render. Generally speaking, quality comes at the expense of framerate and so it may be best not to aim for the highest quality on mobile devices or older hardware since it will have a detrimental effect on gameplay. The Quality Settings inspector (menu: Edit > Project Settings > Quality) is used to select the quality level in the editor for the chosen device. It is split into two main areas - at the top, there is the following matrix:
Unity lets you assign a name to a given combination of quality options for easy reference. The rows of the matrix let you choose which of the different platforms each quality level will apply to. The Default row at the bottom of the matrix is not a quality level in itself but rather sets the default quality level used for each platform (a green checkbox in a column denotes the level currently chosen for that platform). Unity comes with six quality levels pre-enabled but you can add your own levels using the button below the matrix. You can use the trashcan icon (the rightmost column) to delete an unwanted quality level.
You can click on the name of a quality level to select it for editing, which is done in the panel below the settings matrix:
The quality options you can choose for a quality level are as
I have the same issue.
I have enabled 'Use DX11' in the Player Settings and issue was solved.
Unity lets you assign a name to a given combination of quality options for easy reference. The rows of the matrix let you choose which of the different platforms each quality level will apply to. The Default row at the bottom of the matrix is not a quality level in itself but rather sets the default quality level used for each platform (a green checkbox in a column denotes the level currently chosen for that platform). Unity comes with six quality levels pre-enabled but you can add your own levels using the button below the matrix. You can use the trashcan icon (the rightmost column) to delete an unwanted quality level.