How to make a sprite more opaque in Unity 3D - unity3d

I am making a 2D game in Unity 3D. I have a few sprites, but they are so transparent that I can barely see them when the game is running. How can I make them more opaque?

The textures used for the sprites could be semi-transparent, the SpriteRenderer component color alpha value could be set somewhere between transparent and opaque, or the Material could have semi-transparent aspects. Try checking all 3 of these possibilities.

I have just found out that it's easier to do it with GIMP. I open the file representing the spite with GIMP. I select the parts of the sprite from witch I want to remove the transparency using the fuzzy selector (Tools->Selection->Fuzzy), I click on each of them with the right mouse button and choose Level->Tranparency-> Remove alpha channel.
That's pretty much it.

Related

How do you make a custom shape for a sprite from a multiple sprite sheet in Unity

I took a sprite sheet from the Internet and began slicing it in the Unity sprite editor. It was going well, when I found a sprite that was too close to another sprite to encapsulate the whole sprite without cutting off the top of the one below it! My only non-invasive option was to modify the outline of the shape that you use to cut off individual sprites from a sprite sheet. So how do you make a polygon-shaped sprite slice? picture of my sprite sheet
As far as I am aware, there is no way to change the geometry of a sprite in Unity from a rectangular shape. I am not a rendering expert, but the increase in geometry would add unnecessary overhead to the sprite drawing process.
Your best bet is to edit the sprite sheet in an image editing program such as Photoshop or GIMP, so that all sprites fit into a grid form, or at least a form where they don't violate each other's rectangular bounds.
Try to disable polygon mode. Polygon mode will save space but isn't friendly to rectangle mode.

Unity transparent sprite render order

I've been trying to fix this issue for a while. It's about the render order of transparent particle sprites, regardless of the shader used, some of the sprites from the background nebula are rendered above the foreground ones. The image should clarify the situation. The sprites are Quads with materials on them which happen to use the Legacy Shaders/Particles/Alpha Blended shader.
I've even tried setting the renderQueue of the foreground quads' materials to a value higher than that of the background quads, but even that didn't help
It seems whatever I do, the render order of the transparent sprites is messed up. The shader currenty used is Particles/Additive Blend, but using similar shaders didn't really help.
Particle system geometry is batched, so the render order is determined by the particle system itself. In the settings for the particle system, go to the last category "Rendering". In there you should find a field called "Sort Mode" that determines which particles are put in front of others. It sounds like you want the "By Distance" option.

unity3d: Adding half-transparent video with shadows

I'm struggling with an issue that might seem a little bit awkward.
I have some black & white 2d animation (1440x1080px) that I'd like to be played in in a 3d environment in unity3d. Therefor I added a video player to a plane. Now comes the tricky part: I want to make the black areas of the video transparent while the white areas remain visible AND the white areas shall cast shadows on the surrounding. Using the particles shader "additive" does half of the job. But I just can't manage to let the video cast a shadow.
If it worked you would get some 2d "antagonist" (you can't interact with) that looks kind of 3d. Alternatively you could interprete it as some half materialzed holograph that casts shadows.
Is there any (simple) solution I just don't know?
Here some schematic drawing of what I would like to achieve, for better understanding.
The problem right now is: In contrast to my drawing, the desired shadow on the wall doesn't appear... :-/
So, I did never try this but you can maybe add a light in the scene just in front of the video player, that way the light will cast shadows.

How to achieve Terraria/Starbound 2d lighting?

I am making a 2d game in the perspective of Terraria/Starbound. I want the lighting to look similar to this:
Ive tried to get lighting like this by adding a material on all the sprites in my game and then giving them a sprite diffuse shader. Then I made a point light wherever I needed light. There where two problems with this though: 1) Where the light was most intense, it was draining the color of a sprite and made it lighter. 2) I noticed a big FPS drop (And I only had 1 point light!).
Is there any way of achieving lighting like this without having to write my own lighting engine? Ive search the asset store and Ive searched to see if unity has any way of handing 2D lighting from this angle but I have found nothing.
If I do have to write my own lighting engine, would that be to complex for someone who is relatively new to unity and has only had ~ 8 months experience?
Assume you are using tile map.
You need to have a field of view map, which can be achieved by reading this: http://www.redblobgames.com/articles/visibility/
Using such map, you know exactly the color tinting for each tile. Now, just blend the color to the SpriteRenderer of every tile on the map.
Somebody already created a line of sight plugin:
http://forum.unity3d.com/threads/light-of-sight-2d-dynamic-lighting-open-source.295968/
Here's my hacky solution on GitHub
There's 2 cameras.
Empty tiles on the tilemap are filled in with white blocks (only one camera renders this)
A gaussian blur is applied to the camera rendering the white blocks
Then, blend the two cameras, darkening everything not covered by the white blur.
You can adjust the "light" penetration by changing the white tile's sprite's Pixels Per Unit.

Unity2D tile mesh render is darker than source texture

I am making a 2D tile-based game in Unity.
I have a tile mesh implemented roughly along the lines of this wiki entry. Full source code is available at PasteBin. When I look at my graphic (image file) it is precisely the same color as I see in the scene view; however, when I start the game, the mesh is darkened. I notice that when I change the Ambient Light color, it does resolve the issue (sort of): it changes the brightness, but if I set it to pure white, then the colors are too bright (see here). Furthermore, when I have regular GameObjects (such as the brick you see in the second image) they are not affected by this Light setting. I don't understand why the mesh is. Is there a prescribed way to make it totally WYSIWYG? The tileset I am using is here.
Try changing the shader on the material of the renderer to Unlit/Texture or Transparent/Unlit - if you need transparency.