Usefulness of the examples below highly depends on your screen and brightness (crank it up). In perfect conditions, the first image should contain visible lines radiating from the upper left circle. But they aren't supposed to be there. Everything should have been smooth as a newborn baby's butt. So what happened?

There are no textures used, so compression is not the reason. Graphic is generated by shader in real time, and there is no room for floating-point precision error. 

Some may want to make an educated guess on where those lines are coming from. This would...

1. What is Node Notes

In 2014 I made an experimental forum role-play detective game (a failed experiment, people didn't play it much), it was called Mainstream. In it, instead of creating a topic for each Act or for each group of players, I created a topic for each place. And in each place/topic there were links to places nearby. The benefit for such approach was ease of content creation. I would fill topics with descriptions whenever I feel inspired. And whenever players return to the place in their respective stories, all the location-specific information...

You can find the code snippet in my gists , and there is a complete shader.



Unity has an option to set native size on the UI element so it will be positioned perfectly. But if you dive into making a more tricky shaders that work with masks and detail textures which don't match the size of the main texture, you'll find yourself wanting that crisp prescission for them too while avoiding to adjust tiling and offset.

To get there my shader comes with a script that feeds the center of the object in screen space to the mesh for shader to sample a texture with center...

I ran into this when using my Playtime Painter Asset on transparent textures, and noticed the same effect in cases when graphics rendering is involved. Here is a quick solution and explanation: 

In the picture in this article the upper part demonstrates what you see when Alpha is used as transparency, and the image bellow shows what is actually recorded into color channels. Before the red and green stroke were applied, the texture was "empty" black. On the left part I did a simple blit of 4 channels R,G,B and A, so red and green color were blitted...

A wrapper class that makes coding your own editors super easy.

I figured this one out a while back, but wasn't sure if the complexity worth the effort. It may be more optimal to just create a mesh with sub-meshes and apply a different materials to them - not good for performance, but an optimal solution for character models, which also happen not to have tiling in most cases, so regular texture atlasing is a viable solution for performance optimization. Plus, on modern PCs, and I think also Playstation 4, Xbox One there are texture arrays, which could be used instead of my texture atlasing method. But I still decided to exp...

iCfg class is a very manual way to Save (Encode) and Load (Decode) data. I developed it to overcome a challenge of a modular project, with a large team may be developing and using it at the same time. Classes, their structure, method and field naming is constantly changes while their values should not be lost in the process. It works in synergy with my very-fast-to-write inspector methods PEGI.

It is a bit difficult to properly explain what this class do. And I don't think I made a good job of it in this article....

Microdetail is not visible in the first image of this article. But What micro detail does, is keeping the magic ON when you inspect surface up close:

I used my Playtime Painter to combine a bunch of maps into one.

Using detaI maps is relatively performance friendly addition, texture sampling is the one taking up the most time. By packaging up to 4 masks into RGBA texture you reduce that up to 4 times. Also it's a good way to overcome the texture limit. Sure, in some cases you may want to have different tiling and/or offset for different masks, and also different c...

I like cool glossy lighting. It makes virtual environment look real. But what really breaks immersion is when light illuminates object that sits on the other side of the wall from given light. That is why you'll see "Light Range" property for light sources in Unity and Unreal. Property which doesn't make too much sense physically since photons from even the tiniest candle may still affect surface far away. You would tune those to be constrained within the single room and never cast light onto objects outside of it. Range property is also there for performance re...

 Originally, the Color Bleed effect was noticed in photography. As you take a photo of something colorful, with high brightness, the color in photo may get a bit washed - closer to white. This effect wasn't too unwanted, and sometimes even simulated in 3D rendering software to make images more photo-realistic. I added the effect to each of the Shaders of my Playtime Painter Asset (optional, can be toggled ON/OFF globally). Basically it's just a simple operation of:

    float3 mix = col.gbr + col.brg;
    col.rgb += mix * mix*bleedStrength;...

Damage shaders uses texcoord2 coordinates which usually contains UVs for Baked Light. Which means no segment of the texture will not be repeated twice on a mesh. Mesh on the screenshot was created in ProBuilder - now a free editor extension for Unity.  

The example, included with Playtime Painter, has scripts for playtime destruction. When using World Space brush, all painting is done with Render Textures - so no texture uploading to GPU, just a regular rendering - very fast. Also the size of the brush will be in world space, which means a perfectly spherica...

A Beveling which requires only a single face added in place of an edge, while still providing a smooth result. 

This is not related to my Bevel Shader, this is not even a Shader effect. Its actually quite simple and effective. Still haven't found any videos of how to do this in Blender, but there should be, I can't be the only one who thought of this.

I made my own tool for modifying meshes in Unity to do some kinky stuff. And with that tool, as shown in the video below, I can select Dominant Corners. Basically when mesh is rebuild, I calculate a normal for the tr...


Recipe

Simulating Bevel effect in Shader requires additional normal vectors for each vertex:

1. Smooth normal - calculated as if all vertices were shared between triangles.

2. Sharp normal - calculated normally, since all triangles are made of unique vertices.

3. 2 Normal vectors, one for each of triangle lines attached to the vertex.

4. Also one float3 is needed to package edge detection data. 

Vertex count and triangle count remains the same. Transforming the mesh is a matter of selecting a correct mesh profile. In Profile image to the right you can see 3 Line...

The Decay game from a while back. One of the first things I ever created. Here I will list some mechanics used in making Top-Down shooting enjoyable. 

  • Smooth bullet spread: More then one bullet can be shot in between frames, depending on the frame rate. So the function will distribute those bullets between the current and the following frame and displace them so it will not look like a few of them leave the barrel at the same time. It makes fast change in direction feel smoother, and all targets between those directions can be hit.

  • No randomness in bull...

Shader is a code that is executed by your Graphics Processing Unit, (GPU) . If you are a programmer who is planning to write his first shader, or a designer, who feels like taking some additional control over visuals, here is one way to understand the computational power you have at your disposal:

CPU 
Think of your processor, Central Processing Unit - CPU as a very fast guy, who has a calculator and can do almost everything he is told to do. But he can do one single thing at a time. When you hear that a CPU has a bunch of cores it means that there are...

Please reload

Geeky:
GitHub icon
unity-Connet-Logo.png
Discord icon
Social:
Facebook icon
unnamed.png
Instagram icon