Canvas

God Rays

High-performance procedural god rays (crepuscular rays) effect with customizable colors, pulsating intensity, and distortion.


Installation

Install the component

Run the following command to install the component and its dependencies:
npx @motion-core/cli add god-rays

Import the component

Import the component into your Svelte file:
import { GodRays } from "$lib/motion-core";
import { GodRays } from "$lib/motion-core";

Usage

<script lang="ts">
	import { GodRays } from "motion-core";
</script>

<GodRays
	class="h-full min-h-96 w-full"
	color="#FFFFFF"
	backgroundColor="#191A1D"
	intensity={0.35}
/>

Props

GodRays

PropTypeDefault
color
"THREE.ColorRepresentation" "#FFFFFF"
backgroundColor
"THREE.ColorRepresentation" "#000000"
anchorX
number 0.5
anchorY
number 1.2
directionX
number 0.0
directionY
number -1.0
speed
number 1.0
lightSpread
number 1.0
rayLength
number 1.0
pulsating
boolean false
fadeDistance
number 1.0
saturation
number 1.0
noiseAmount
number 0.0
distortion
number 0.0
class
string ""