Uploaded March 2018 | Updated November 2026, 2 hours ago
Webhooks are really popular these days. Every service seems to have support for them these days. Lets try using these fancy new function as a service things to consume them. Specifically, let's take advantage of the included GitHub Webhook support in Azure Functions to build a service that can react to actions that happen on my public World of Zero GitHub.
This isn't really a look at implementing too much with Azure Functions themselves. They're literally just functions, if you know how to work with those then you already know all you need to to work with them. Instead we're going to focus on how to publish our function from Visual Studio, how to connect it to the GitHub webhook implementation and make sure everything is working as we intended.
Do you have other ideas we could leverage these kinds of serverless apps in? Let me know! Besides using them to consume webhooks you can hook them up to basic HTTP endpoints to build web services or attach them to a message queue to automatically consume messages as they arrive.
Like I mentioned there are a number of these Function as a Service offering. Amazon Lambda was the first cloud provider to offer the service, but both Microsoft and Google have introduced similar offerings. Besides that a number of OSS versions exist including Fission, RIFF (RIFF is For Functions) and OpenFAAS. Hybrids of this kind of design also exist in the form of Spring Cloud Functions as an example.
Currently the open source offerings are in some form of alpha or beta version (at least that I know of) so they're a bit more limiting when compared to what Amazon, Google and Microsoft offer in this space. Have you tried any of them out? Which did you prefer?
Discord: discord.gg/hU5Kq2u
Webhooks are really popular these days. Every service seems to have support for them these days. Lets try using these fancy new function as a service things to consume them. Specifically, let's take advantage of the included GitHub Webhook support in Azure Functions to build a service that can react to actions that happen on my public World of Zero GitHub.
This isn't really a look at implementing too much with Azure Functions themselves. They're literally just functions, if you know how to work with those then you already know all you need to to work with them. Instead we're going to focus on how to publish our function from Visual Studio, how to connect it to the GitHub webhook implementation and make sure everything is working as we intended.
Do you have other ideas we could leverage these kinds of serverless apps in? Let me know! Besides using them to consume webhooks you can hook them up to basic HTTP endpoints to build web services or attach them to a message queue to automatically consume messages as they arrive.
Like I mentioned there are a number of these Function as a Service offering. Amazon Lambda was the first cloud provider to offer the service, but both Microsoft and Google have introduced similar offerings. Besides that a number of OSS versions exist including Fission, RIFF (RIFF is For Functions) and OpenFAAS. Hybrids of this kind of design also exist in the form of Spring Cloud Functions as an example.
Currently the open source offerings are in some form of alpha or beta version (at least that I know of) so they're a bit more limiting when compared to what Amazon, Google and Microsoft offer in this space. Have you tried any of them out? Which did you prefer?
Discord: discord.gg/hU5Kq2u

. This retrieves a `MonoBehavior` from any `GameObject` in our scene which matches the type were searching for. This search method is not the final solution well end up using later in development, but for testing right now its more than enough to get us what we want. We can use the reference we retrieve to replace the actual instantiation, effectively moving the parts of the code we want into a separate place.
To make things a little easier and to make sure our new component is more useful well still do some of the lifting in the Asteroids code. This includes calculating the rotation and world position of each new Chunk of the Asteroid. We do this so that the controller we built can be used to generate brand new Asteroids and not just create debris from existing ones.
There is still a bit more to do to get a fully functioning destruction system (we dont track health yet for example), but this gets us to a place where object destruction and creation works reliably well.
The base subdivision destruction system was built in a Live Stream which you can find here: https://youtu.be/POVJ-QIyygE
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Creating a Subchunk Spawner for Asteroids VR](https://i.ytimg.com/vi/VaGI6j_4e7Y/mqdefault.jpg)




![I Learn How To Make Bash Flip Tables When I Break Things
Lets take a look at how to customize a `bash` shell. Well be making our shell print a table flip whenever the last command failed. In order to customize your prompt you can overwrite the `PS1` environment variable.
To see what your current prompt is set to you can run `echo $PS1`
The table flip script looks like this:
```bash
table_flip() {
if [[ $? 0 ]]; then
echo
else
echo (╯°□°)╯︵ ┻━┻
fi
}
```
Here is a tool that can help you customize your prompt more easily: http://ezprompt.net/
The ArchLinux wiki goes into much more detail about prompt customization: https://wiki.archlinux.org/index.php/Bash/Prompt_customization#Bash_escape_sequences
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u I Learn How To Make Bash Flip Tables When I Break Things](https://i.ytimg.com/vi/XUOti_9WgaM/mqdefault.jpg)

 class that provides some helper functions to make this easier.
The first thing to do is define a set of planes we can use to describe the view of our camera. This is called a frustum and is the white box-like gizmo you see in Unitys scene editor when you select a `Camera`. The frustum defines your cameras view and we can take advantage of this to test if objects are inside or outside of the bounds we calculate.
In order to calculate the frustum planes well want to run `GeometryUtility.CalculateFrustumPlanes(...)` and pass in the camera we want to calculate the Frustum of. In our quick example well use `Camera.main` to grab the main camera in our scene.
Once weve calculated the camera frustum planes we can provide those to the `GeometryUtility.TestPlanesAABB(...)` method to test if the bounding box we provide is inside or outside of the planes we calculated earlier. This method returns true if the bounding box provided overlaps with or is inside of the `Plane[]` boundaries. In this case were testing if a bounding box overlaps or is inside of the cameras viewport.
To get the bounds of an object you can use the `Collider.bounds` field. This calculates a world space axis-aligned bounding box for the collider and returns it to you so you can reference it in your object. The bounds are always a box aligned to the XYZ planes but are supported on all types of `Collider` in Unity.
Once youve passed your bounds into the test function you can use that to perform your behavior for objects in or out of view. This can be used to freeze objects when they come into view (like the Doctor Who Angels) or to move/delete an object when it gets out of sight (like some gibs you only want to be cleaned up when the player looks away). Theres a lot of different uses for functions like this!
The code Im using in this example has an `Update` that looks like this:
```csharp
var bounds = collider.bounds;
cameraFrustum = GeometryUtility.CalculateFrustumPlanes(camera);
if (GeometryUtility.TestPlanesAABB(cameraFrustum, bounds))
{
renderer.sharedMaterial.color = Color.green;
}
else
{
renderer.sharedMaterial.color = Color.red;
}
```
You can learn more about dot product here: https://youtu.be/8cZo-c-f1yc
***
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Detect Objects in Your Camera View - Unity Geometry Utilities](https://i.ytimg.com/vi/XrqesjfcitU/mqdefault.jpg)
![Exploring How to Write Custom Pixel Shaders for the Windows Terminal
The Windows Terminal is a new terminal for Windows that allows you to run PowerShell, Command Prompt, the Azure Command Shell or any other terminal environment. One of the cool experimental features it includes is the ability to run a custom DirectX pixel shader when rendering the terminal. This can allow you to customize your prompt and create cool visual effects in your Terminal. Lets explore how you can configure and create your own shader for the Windows Terminal!
To use a shader you will need to update your Windows Terminals `settings.json` file to point to a DirectX pixel shader file. The setting is called experimental.pixelShaderPath and is located in your terminals profiles. In this example well be applying the shader to every profile in our terminal by default by updating our settings file like this:
```diff
profiles:
{
defaults:
{
...
+ experimental.pixelShaderPath: The absolute path to our shader.hlsl,
}
}
```
A basic shader that just rerenders the sampled terminal input might look like this:
```hlsl
Texture2D shaderTexture;
SamplerState samplerState;
float4 main(float4 pos : SV_POSITION, float2 tex : TEXCOORD) : SV_TARGET {
return shaderTexture.Sample(samplerState, tex);
}
```
It includes a `shaderTexture` which is a Texture that contains the rendered content of the Terminal prior to your shader being applied. This means it will include the colored text but none of your effects. A `samplerState` is also provided which provides state information about sampling the texture.
The shader requires a `main` method that returns a four dimensional vector containing the red, green, blue and alpha channels to render. A transparent result will render the background of your terminal profile.
To modify the behavior of the shader, change the results returned from the `main` method to match your desired outcome and update the Windows Terminal. You should be able to see the results of your changes. For example our shader that only renders the red channel of our terminal has a `main` method that looks like this:
```hlsl
float4 main(float4 pos : SV_POSITION, float2 tex : TEXCOORD) : SV_TARGET {
float4 color = shaderTexture.Sample(samplerState, tex);
return float4(color.r, 0, 0, color.a) ;
}
```
Some additional documentation on Windows Terminal pixel shaders is available on the Windows Terminal GitHub page here: https://github.com/microsoft/terminal/blob/main/samples/PixelShaders/README.md
That README includes additional information including how to access the `PixelShaderSettings` which provide information such as a `Time` variable to create animated effects!
***
If youd like to add a shortcut that can toggle shader effects on or off then you can add an action to your Windows Terminals `settings.json` file. In the `actions` block add an entry for `toggleShaderEffects` like this:
```json
actions:
[
...
{
command: toggleShaderEffects,
keys: shift+f10
}
]
```
In my example pressing the Shift and F10 key would toggle shader effects.
***
If you dont have the Windows Terminal you can download it here: https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701
You can find some additional examples of Windows Terminal shaders here: https://github.com/Hammster/windows-terminal-shaders
My pride flag Windows Terminal shader is located here: https://worldofzero.com/posts/pride-windows-terminal/
Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u Exploring How to Write Custom Pixel Shaders for the Windows Terminal](https://i.ytimg.com/vi/YF50axsb-cA/mqdefault.jpg)
