Unity3D, Glass Shader, prevent rifts - unity3d

I'm new to Unity and 3D and currently working on a 3D model of a smartphone. I have a Mesh that uses Standard shader with glass material. This mesh covers all of the surface, and is able to fill in any rifts that exist on the model.
My glass material looks like this:
The properties:
The model:
The problem is that this shader is black, it's covering other elements of the model, like camera, if I remove it, the model will look like this:
which is ok, but you may see that there are little gaps near to the camera, the rifts:
I have no idea how to fill this gaps and use glass shader in the same time.
Also, I cannot use Standard shader, because it doesn't work on mobile devices.
I tried to apply any other Glass Shaders with lower LOD, which seem to work, but the gaps still remain.
Any help is highly appreciated.

Okay, so I played around with the Standard Shader and the main problem you have is that it has no transparency at all. You won't be able to look through it if it has no alpha.
What I did to get results that seemed "okay" is:
I set the rendering mode to Transparent
I set the color to #0024050C
I set the Metallic to 0
I set the Smoothness to 0.9
I kept everything else on default
There may be a comparable version for the Standard (Specular) setup:
Same values as above
Specular to #181818FF
Source to Specular Alpha
And as far as I know, the Standard Shader should work on mobile with some features disabled.

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.

Unity 3D Vs 3DS Max Default Models Colors Variance

I was getting 3d models color difference in 3DS Max (My 3d models designing software) compare to Unity (My game development engine). For your reference, I have taken one example screenshot for better understanding.
In 3DS Max, its looking lighter and in cool colors. In Unity 3D, its looking darker and shiny colors.
If I check color code in Unity 3d, then it's proper it should require to look same but then why I was seeing all things in cool colors in 3DS Max!!!
In all 3d models, I was getting this kind of color difference when I import within the Unity game engine.
Because of this, the creation of an environment look and feel become really difficult for me.
In the above example, in both software, I didn't change any kind of default settings related to lighting or anything else.
What to do in this case for getting the exact same thing from 3DS Max to Unity 3D?
Try disabling Gamma correction in 3ds Max:
Rendering menu -> Gamma/LUT setup... -> Gamma and LUT tab -> Uncheck "Enable Gamma/LUT Correction" checkbox.
Default gamma of 2.2 can make colors appear washed out. This is actually important in a lot of architectural and realistic rendering scenarios, but not necessarily needed for games.
In Photoshop, increasing the "Unity" side of your image to a gamma of 2.2 seems to produce more consistent colors with the "3ds Max" side. However, there are also differences in lighting, light angle, and background color.
In the materials settings in Unity you can control which objects receive and cast shadows. It looks like some of your models aren't receiving or casting shadows. I'd also try to adjust the light directions like some of the other users said.
Also it should be easy to change the skybox from the light blue to a black in the Camera settings to match your max scene.
I think there is likely a lot of reasons, from material settings, lighting settings etc. One thing you can try is to switch your Unity Project from Gamma Space to Linear Space,
Edit>Project Settings>Player->Color Space. Linear Space usually improves the look in your scene allowing your objects to brighten linearly.
https://docs.unity3d.com/Manual/LinearRendering-LinearOrGammaWorkflow.html

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.

Shader to bevel the edges of a cube?

This question relates to using shaders (probably in the Unity3D milieu, but Metal or OpenGL is fine), to achieve rounded edges on a mesh-minimal cube.
I wish to use only 12-triangle minimalist mesh cubes,
and then via the shader,
Achieve the edges (/corners) of each block being slightly bevelled.
In fact, can this be done with a shader?
I recently finished creating such shader. The only way it can work is by providing 4 normal vectors instead of one for each vertex (smooth, sharp and one for each edge of the triangle for the given vertex). You will also need one float3 to detect edges.
To add such data in a mesh I made a custom mesh editor, comes with Playtime Painter Asset from Unity Asset Store. Will post the shader with the next update. Also will post to public GitHub.
You can see some dark lines, it's because it starts to interpolate to a normal vector which facing away from light source, but since there are no additional triangles, the result is visible on a triangle which is facing the camera.
Update (2/12/2018)
Realised that by clipping pixels that end up having a normal facing away from the camera, it is possible to smooth the outline shape. It wasn't tested for all possible scenarios but works great for simple shapes:
As per request added a comparison cube:
Currently, Playtime Painter has a simplified version of that shader, which interpolates between 2 normal vectors and gives ok results on some edges.
Wrote an article.
In general the Relief Mapping is able to modify the object silhouette like on this picture. You'd need to prepare a heightmap that lowers at the borders and that's it. However I think that using such shader might be an overkill for such a simple effect so maybe it's better to just make it in your geometry.