Unity2D tile mesh render is darker than source texture - unity3d

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.

Related

Unity - particle system material like this?

Im trying to copy this fire system https://realtimevfx.com/t/sketch-10-jordanov/4273/7 the smoke here especially:
https://www.youtube.com/watch?time_continue=2&v=Wwj3Y6ieTlI
So far not much luck, mainly because when I try to emulate the smoke by setting the material to a fade alpha, or even cutout alpha, the overlapping particles become this:
See, they overlap instead of being a solid stream. Is this not possible in Unity?
There's a few possibilities for this.
The texture you're using for your particle has the color fading to black on the RGB channels, instead of being pure white or blue and only having the alpha channel contain the circle pattern.
The shader being used is "pre-multiplying" the color by the alpha, giving a darker look around semitransparent overlaps.
The particles are being lit and thus differences in position can result in differences in lighting, breaking color/shading continuity.
If you use a Unity "Unlit" particle shader, there should be no visible overlaps, assuming you don't have the first issue. I'd recommend trying some of the other shader options available in the Particle section and Mobile>Particle section.

How to make this lighting effect in HaxeFlixel or Unity?

How do I create this lighting effect in HaxeFlixel or Unity ?
I will tell you how it was created in this specific case. This question is very broad and there are very many ways to create lighting effects in both Unity and HaxeFlixel.
The image is of the game Beneath the City by Deepnight, accessible on his website. The game uses haxe although not with HaxeFlixel. It's deepnight's personal engine that works with the flash target. The source code is available here. The class where lighting takes place is in src/Level.hx and more specifically in the renderLights method. From what I gather, a light layer is layered above the sprites of the level. This layer (or bitmap data) has lights drawn as rectangles on it. This layer is then blurred, so that the lights don't appear as solid rectangles, but as faded blurs of spreading light. This takes place with flash blur filters. Blend modes are used to make the light Add in luminosity. A dark mask is then layered above the blur layer, presumably to prevent light in certain locations, such as in the fog of the game. (?). This all takes place between lines 208 and 248.
This game truly does have gorgous visuals, but the lighting goes beyond the initial blurred lights. Particles float around in the game that really add to the lightings aesthetic.
This is all how he does it though. How you do it is up to you. For HaxeFlixel, I would first consider alternatives such as this geometric lighting or this method of applying lighting to scenes, which looks closer to screenshot or even a very simple circle based lighting alternative. Searching Unity 2D lighting brings up plenty of options.
You've got plenty of options on how to approach the issue. I didn't answer this with a direct tutorial because the question isn't at the code level.

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.

Unity3D Gui Sphere having distorted edges

I'm trying to make a make switch board with circular button.
For it i'm using Quad as a base and then overlaying 3D Spheres for the buttons.
For the texture of sphere's, I have made a Material to which a rectangular image is set.
in preview it looks good with all smooth edges, however, in game preview when I look closely at the sphere's their edges are distorted/pixelated.
Is there any restriction which should be adhered to make the sphere's have perfect smooth edges.
or I must be missing something.
Image uploaded. The Quad is of White color and there is a light source.
the texture was imported and overridden for platform for 2048.

How to make a sprite more opaque in Unity 3D

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.