Uploaded July 2019 | Updated November 2026, 3 hours ago
In previous videos we've built a pixel shader that renders circles instead of the traditional squares. You can rotate the pixels so that the circles can be oriented at any angle to one another. Lets bring that rotating ability to a more standard pixel shader so that we can rotate the pixels of our shader without having to physically rotate the mesh. This should be handy for things like image effects or just being able to create more unique pixel art.
Most of the concepts that we'll use in this have already been covered in previous videos of the series so we'll use this as a way to quickly review some of the different aspects of each part of our circular pixel shader, select the parts we still want and then apply them to create this new effect.
If you want to checkout the earlier videos in this series where we build a series of circular pixel shaders and go into more depth on how all this works you can do that here: youtube.com/watch?v=mNyZKyVfPeU&list=PLEwYhelKHmigkbFMrVnz4MbmmFzhL2qL4
The code for this shader and the other circular pixel shaders we've built in this series are open source and available on GitHub! You can download the code with this link: github.com/WorldOfZero/UnityVisualizations/tree/master/CirclePixels
Join the World of Zero Discord Server: discord.gg/hU5Kq2u
In previous videos we've built a pixel shader that renders circles instead of the traditional squares. You can rotate the pixels so that the circles can be oriented at any angle to one another. Lets bring that rotating ability to a more standard pixel shader so that we can rotate the pixels of our shader without having to physically rotate the mesh. This should be handy for things like image effects or just being able to create more unique pixel art.
Most of the concepts that we'll use in this have already been covered in previous videos of the series so we'll use this as a way to quickly review some of the different aspects of each part of our circular pixel shader, select the parts we still want and then apply them to create this new effect.
If you want to checkout the earlier videos in this series where we build a series of circular pixel shaders and go into more depth on how all this works you can do that here: youtube.com/watch?v=mNyZKyVfPeU&list=PLEwYhelKHmigkbFMrVnz4MbmmFzhL2qL4
The code for this shader and the other circular pixel shaders we've built in this series are open source and available on GitHub! You can download the code with this link: github.com/WorldOfZero/UnityVisualizations/tree/master/CirclePixels
Join the World of Zero Discord Server: discord.gg/hU5Kq2u


![Exploring Top-Level Programs in C# 9
Top-Level Programs is a new feature being introduced in C# 9.0 that significantly simplifies certain C# programs and allows you to remove almost all of the boilerplate code from them. This pattern allows you to call functions at the top-level of your C# program meaning that you do not need a class or function definition in order to call those functions. Instead C# automatically generates that code for you when your code is compiled.
The simplest top-level program is just one line:
```csharp
System.Console.WriteLine(Hello, World of Zero!);
```
There are a few special features included with top-level programs that help you to fully use some of the features like accepting command line arguments or async functions.
### `args` variable
C#s top-level programs include a magic `args` variable which contains a `string[]` of command-line arguments provided. Here is a working example script that accepts a command line argument to greet you by name.
```csharp
using System;
// If there is 1 argument greet that argument by name
if (args.Length 1)
{
Console.WriteLine($Hello, {args[0]}!);
} else { // Otherwise greet a generic Internet 🤖
Console.WriteLine(Hello Internet!);
}
```
Use `dotnet run World of Zero` or similar to run this code and be greeted with Hello, World of Zero!
### `async` and `await` support
You may take advantage of async functions inside of a top-level program. This allows for things like async file operations, web requests etc to be made without having to wrap them in a separate async function.
For example this task will print two numbers with a short pause between them.
```csharp
using System;
using System.Threading.Tasks;
Console.WriteLine(One);
await Task.Delay(1000);
Console.WriteLine(Two);
```
***
More info about some of the new features in C# 9.0 and how to use them is available here: https://devblogs.microsoft.com/dotnet/welcome-to-c-9-0/
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Exploring Top-Level Programs in C# 9](https://i.ytimg.com/vi/uxxROAx6MMU/mqdefault.jpg)
![Installing Nyancat using the .NET CLI
The .NET CLI includes the ability to install additional developer tools like powershell. This is a powerful feature that enables you to add tools to your developer environment without leaving your terminal. In this video well take full advantage of the feature by installing an animated nyancat tool. My productivity will never been the same!
To learn more run `dotnet tool help`.
You may use `dotnet tool install [PACKAGE_NAME]` and dotnet tool uninstall `[PACKAGE_NAME]` to install and uninstall packages.
The tool uses the same Nuget package manager that provides your dotnet libraries and chocolatey packages.
You can explore the available tools on [ToolGet](https://www.toolget.net/).
More information about managing dotnet tools: https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Installing Nyancat using the .NET CLI](https://i.ytimg.com/vi/uzaFeSxM32k/mqdefault.jpg)


 a project for creating an interactive data notebook. Its extremely common among data scientists and python programmers as a way to document an AI model and show the data that is being worked on. We are able to take advantage of that same platform and provide a .NET runtime (.NET interactive) that allows us to compile and run .NET code in these notebooks. This gives us access to many of the same features while allowing us to write our code in C# or another .NET language.
***
* You can learn more about Project Jupyter here: https://jupyter.org/
* You can find more information about working with Jupyter Notebooks in VS Code here: https://code.visualstudio.com/docs/datascience/jupyter-notebooks
* The Jupyter extension for Visual Studio Code is available here: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
* .NET Interactive is open source on GitHub here: https://github.com/dotnet/interactive
***
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Using .NET Interactive and Jupyter Notebooks](https://i.ytimg.com/vi/vlp4B6C81xQ/mqdefault.jpg)
 object. This provides information about the collider you impacted, the point of impact, that objects transform and more. Because of the way values are returned a typical pattern of using Raycasts looks like this:
```csharp
var ray = new Ray(this.transform.position, this.transform.forward);
RaycastHit hit;
if (Physics.Raycast(ray, out hit))
{
objectHit = hit.transform.gameObject;
}
```
### Raycasting Examples
Here is a collection of a few ways you could apply raycasts from my previous projects:
* [Obstacle Avoidance and Steering Algorithms](https://youtu.be/SVazwHyfB7g)
* [Reflecting Projectiles Off Walls](https://youtu.be/GttdLYKEJAM)
* [Adding Gravity and Trajectory Prediction](https://youtu.be/d7pwmO6IS2I)
* [Projectile Penetration and Shooting Through Walls](https://youtu.be/RIru7m73HZA)
* [Help Debugging Rays with Unity Gizmos](https://www.youtube.com/watch?v=USwrSUpIgLI)
### Raycast Alternatives
Unity includes a set of functions that can be used in place of raycasts that use different shapes such as spheres or boxes to detect collisions. These function similarly to raycasts for the most part besides having a different shape.
#### [`SphereCast`](https://docs.unity3d.com/ScriptReference/Physics.SphereCast.html)
`SphereCast` projects a sphere along a ray effectively allowing your raycast to have a radius around itself when detecting objects. This has a few uses but one of the most common is in the development of [third person cameras](https://youtu.be/Cfcr7FtbYQo) to prevent them from clipping into level geometry and ensure they behave more cleanly in tight corners.
#### [`BoxCast`](https://docs.unity3d.com/ScriptReference/Physics.BoxCast.html)
`Boxcast` projects a box along the ray and allow you to test if a box may move without colliding with an object.
#### [`CapsuleCast`](https://docs.unity3d.com/ScriptReference/Physics.CapsuleCast.html)
`CapsuleCast` projects a capsule along a ray and can be useful for detecting things like potential player movement.
#### [`LineCast`](https://docs.unity3d.com/ScriptReference/Physics.Linecast.html)
This functions identically to a `Raycast` however instead of expecting an origin and direction and `LineCast` expects two points and detects if an object is between those two points.
### 2D Raycasts
Variants of the 3D Raycasts and its alternatives can be used when your using Unitys 2D Physics system. These have a different syntax and the two raycasting systems are *not* intercompatible. `Physics.Raycast` will interact with 3D Colliders, `Physics2D.Raycast` will interact with 2D Colliders. To learn more about using Raycasts in a 2D scene see the documentation for [`Physics2D.Raycast`](https://docs.unity3d.com/ScriptReference/Physics2D.Raycast.html).
***
The Raycasting documentation is here: https://docs.unity3d.com/ScriptReference/Physics.Raycast.html
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u
Ive published additional content on my website at https://worldofzero.com
You may find some of the World of Zero Open Source projects at https://github.com/WorldOfZero Detecting Objects with Raycasts in Unity3D](https://i.ytimg.com/vi/vqc9f7HU-Vc/mqdefault.jpg)
![Using Command Prompt to Create a Symbolic Link on Windows
Symbolic Links allow you to create a reference in your file system to another file or directory. This allows you to reference the same file in multiple places without having to physically copy it into each place. This can save storage space and also allows a single change to the file to be seen by every location that links to it as well.
In this video well be taking a look at how to create these Symbolic Links from the Command Prompt using the `mklink` command. In order to use this command youll need to be running Command Prompt as an administrator. `mklink` can be used to create symlinks between files and directories however the syntax is slightly different depending on which youll be using.
When creating a symlink between files you may use:
```cmd
mklink [path] [target]
```
However if youre creating a symlink between directories youll need to include the `/D` flag.
```cmd
mklink /D [path] [target]
```
In both of these examples a new file or directory will be created at the `path` that links to the object located at the `target`.
The `mklink` command also allows you to create hard links and directory junctions as well. You may learn more about using it by running `mklink -?` in your prompt.
If you see the You do not have sufficient privilege to perform this operation error make sure you are in an Administrator Command Prompt.
If you prefer Powershell you can learn how to make a symbolic link in Powershell here: https://youtu.be/_VnONfOgP8M
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Using Command Prompt to Create a Symbolic Link on Windows](https://i.ytimg.com/vi/w2gxWTOPw7U/mqdefault.jpg)

