Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Dynamic Crosshair Shader

An asset by 0xspig
The page banner background of a mountain and forest
Dynamic Crosshair Shader thumbnail image
Dynamic Crosshair Shader thumbnail image
Dynamic Crosshair Shader thumbnail image
Dynamic Crosshair Shader image holder but it is empty

Quick Information

0 ratings
Dynamic Crosshair Shader icon image
0xspig
Dynamic Crosshair Shader

Dynamic crosshair shader for godot##InstallationCreate a ColorRect, set the size to your resolution so it covers the entire viewport. Apply the shader to the ColorRect.##CustomizationColors, size, spacing, etc. are editable in shader params. "inverted" overrides all color and replaces it with an inverted screenbuffer.color_id enables color_%id (color_id == 1, color_1 is active color)."spread" is the scale factor of "spacing". The space between each section is spacing * spread. 1 is the default value.See readme for example usage.

Supported Engine Version
3.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
4 years ago
Git URL
Issue URL

CrosshairShader

Dynamic crosshair shader for godot

Installation

Create a ColorRect, set the size to your resolution so it covers the entire viewport. Apply the shader to the ColorRect.

Customization

Colors, size, spacing, etc. are editable in shader params.

invertedoption overrides all color and replaces it with an inverted screenbuffer.

color_id enables color_%id. Example usage (sets active color to color_1 when a raycast is intersecting an enemey):

var cursor_object = $UpperCollider/Camera/RayCast.get_collider()
if cursor_object == null:
    $HUD/Crosshair.material.set_shader_param("color_id", 0)
elif cursor_object.is_in_group("enemy"):
    print("enemy")
    $HUD/Crosshair.material.set_shader_param("color_id", 1)
  

spread determines the factor of spacing. The space between each section is spacing * spread. 1 is the default value. Example usage (spread dependent on player velocity):

var spread = velocity.length()/2 + 1
$Crosshair.material.set_shader_param("spread", spread)

Dynamic crosshair shader for godot

##Installation
Create a ColorRect, set the size to your resolution so it covers the entire viewport. Apply the shader to the ColorRect.

##Customization
Colors, size, spacing, etc. are editable in shader params. "inverted" overrides all color and replaces it with an inverted screenbuffer.

color_id enables color_%id (color_id == 1, color_1 is active color).

"spread" is the scale factor of "spacing". The space between each section is spacing * spread. 1 is the default value.

See readme for example usage.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Dynamic Crosshair Shader icon image
0xspig
Dynamic Crosshair Shader

Dynamic crosshair shader for godot##InstallationCreate a ColorRect, set the size to your resolution so it covers the entire viewport. Apply the shader to the ColorRect.##CustomizationColors, size, spacing, etc. are editable in shader params. "inverted" overrides all color and replaces it with an inverted screenbuffer.color_id enables color_%id (color_id == 1, color_1 is active color)."spread" is the scale factor of "spacing". The space between each section is spacing * spread. 1 is the default value.See readme for example usage.

Supported Engine Version
3.2
Version String
1.0
License Version
MIT
Support Level
community
Modified Date
4 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers