Agent skill

Add Compute Shader

by lge-ros2 in lge-ros2/cloisim

Add a new compute or surface shader for sensor data processing or visualization.

MITAuto-check passedGame Development

Install Add Compute Shader

skills CLI
$ npx skills add lge-ros2/cloisim --skill add-compute-shader -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lge-ros2/cloisim add-compute-shader --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lge-ros2/cloisim.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/add-compute-shader .claude/skills/add-compute-shader && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-compute-shader
GitHub stars
176
Token cost
~2.1k tokens
SKILL.md length
301 words
Files
1
Skills in repo
18
Repo updated
First seen
Licence
MIT

At a glance

Add a new compute or surface shader for sensor data processing or visualization.

  • : implementing GPU-side sensor processing
  • SKILL.md covers When to Use, Shader Types in CLOiSim, Procedure and Naming Conventions, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Adding a new visual effect

What it does

Add Compute Shader is an agent skill from lge-ros2/cloisim. Add a new compute or surface shader for sensor data processing or visualization. Use when: implementing GPU-side sensor processing, adding a new visual effect, creating a ray tracing shader for a sensor.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering Shaders. The repository describes itself as: Unity 6 based multi-robot simulator for ROS 2, SDFormat/SDF, LiDAR, camera, depth, IMU, GPS, and large-scale robotics simulation. The licence is MIT.

When your agent uses it

  • : implementing GPU-side sensor processing
  • Adding a new visual effect
  • Creating a ray tracing shader for a sensor

Example prompts

  • “/add-compute-shader”

What it can do on your machine

Read from SKILL.md and the folder at commit f4c1f0b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are hlsl and csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Compute Shader loads about 2.1k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 301 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~56
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from lge-ros2/cloisim at commit f4c1f0b, republished under its MIT licence (© lge-ros2). 301 words, ~2,141 tokens.

Download SKILL.mdSave it as .claude/skills/add-compute-shader/SKILL.md (or your agent's skills folder).
name
add-compute-shader
description
Add a new compute or surface shader for sensor data processing or visualization. Use when: implementing GPU-side sensor processing, adding a new visual effect, creating a ray tracing shader for a sensor.

Add a New Shader

Procedure for adding a compute shader (for GPU-side sensor processing) or a surface/fragment shader (for visualization) to CLOiSim.

When to Use

  • Processing sensor data on the GPU (depth scaling, noise, point cloud generation)
  • Adding a new ray tracing shader for a sensor (lidar)
  • Creating a visual effect (segmentation overlay, grass rendering, video texture)
  • Adding a post-processing pass for a camera sensor

Shader Types in CLOiSim

TypePatternExamples
Traditional ComputeStructuredBuffer I/O, cbuffer paramsDepthBufferScaling.compute, VCSELPrepass.compute
URT Ray TracingUnified Ray Tracing with _AccelStructLidarRayTrace.compute, LivoxLidarRayTrace.compute
Surface/FragmentURP vertex/fragment shaderAddGaussianNoise.shader, Segmentation.shader, DepthRange.shader (depth camera, rasterization-based, Blitter-driven)
GeometryURP with geometry stageGeometryGrass.shader

Procedure

Option A: Traditional Compute Shader

Create Assets/Resources/Shader/MyCompute.compute:

hlsl
/*
 * Copyright (c) 2026 LG Electronics Inc.
 *
 * SPDX-License-Identifier: MIT
 */

#pragma kernel CSMyKernel

#define THREADS 16
#define GROUPS 16

// Input/output buffers
StructuredBuffer<float> _Input;
RWStructuredBuffer<float> _Output;

// Parameters in a cbuffer for efficient batching
cbuffer Params {
	uint _Width;
	uint _Height;
	float _ScaleFactor;
};

// Mark small utility functions inline
inline float MyHelper(const float value) {
	return value * _ScaleFactor;
}

[numthreads(THREADS, GROUPS, 1)]
void CSMyKernel(uint3 id : SV_DispatchThreadID) {
	if (id.x >= _Width || id.y >= _Height)
		return;

	const uint index = id.y * _Width + id.x;
	_Output[index] = MyHelper(_Input[index]);
}

C# dispatch side (in a Device or Manager class):

csharp
private ComputeShader _computeShader;
private int _kernelIndex;
private ComputeBuffer _inputBuffer;
private ComputeBuffer _outputBuffer;

private void InitializeShader()
{
	_computeShader = Resources.Load<ComputeShader>("Shader/MyCompute");
	_kernelIndex = _computeShader.FindKernel("CSMyKernel");

	_inputBuffer = new ComputeBuffer(width * height, sizeof(float));
	_outputBuffer = new ComputeBuffer(width * height, sizeof(float));

	_computeShader.SetBuffer(_kernelIndex, "_Input", _inputBuffer);
	_computeShader.SetBuffer(_kernelIndex, "_Output", _outputBuffer);
	_computeShader.SetInt("_Width", width);
	_computeShader.SetInt("_Height", height);
	_computeShader.SetFloat("_ScaleFactor", scaleFactor);
}

private void Dispatch()
{
	var threadGroupsX = Mathf.CeilToInt((float)_width / 16);
	var threadGroupsY = Mathf.CeilToInt((float)_height / 16);
	_computeShader.Dispatch(_kernelIndex, threadGroupsX, threadGroupsY, 1);
}
Option B: URT Ray Tracing Compute Shader

Create Assets/Resources/Shader/MyRayTrace.compute:

hlsl
/*
 * Copyright (c) 2026 LG Electronics Inc.
 *
 * SPDX-License-Identifier: MIT
 */

#pragma only_renderers d3d11 vulkan metal
#pragma target 4.5

#pragma kernel MainRayGenShader
#pragma kernel ComputeIndirectDispatchDims

// URT Compute backend setup
#define UNIFIED_RT_BACKEND_COMPUTE
#define UNIFIED_RT_GROUP_SIZE_X 16
#define UNIFIED_RT_GROUP_SIZE_Y 8

#include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/Bindings.hlsl"
#include "Packages/com.unity.render-pipelines.core/Runtime/UnifiedRayTracing/TraceRayAndQueryHit.hlsl"

// Acceleration structure
UNIFIED_RT_DECLARE_ACCEL_STRUCT(_AccelStruct);

// Output buffer
RWStructuredBuffer<float> _Output;

// Sensor parameters
uint _SamplesH;
uint _SamplesV;
float _RangeMin;
float _RangeMax;
float3 _SensorPosition;
float3 _SensorForward;
float3 _SensorRight;
float3 _SensorUp;

// Custom parameters for your sensor
float _MyParam;

void RayGenExecute(UnifiedRT::DispatchInfo dispatchInfo)
{
	const uint2 pixel = dispatchInfo.dispatchThreadID.xy;
	if (pixel.x >= _SamplesH || pixel.y >= _SamplesV)
		return;

	// Build ray direction from sensor parameters
	float3 dirWorld = normalize(/* compute from angles/pixel */);

	UnifiedRT::Ray ray;
	ray.origin    = _SensorPosition;
	ray.direction = dirWorld;
	ray.tMin      = _RangeMin;
	ray.tMax      = _RangeMax;

	UnifiedRT::RayTracingAccelStruct accelStruct = UNIFIED_RT_GET_ACCEL_STRUCT(_AccelStruct);
	UnifiedRT::Hit hit = UnifiedRT::TraceRayClosestHit(
		dispatchInfo, accelStruct, 0xFF, ray, UnifiedRT::kRayFlagNone);

	float dist = asfloat(0x7FC00000); // NaN = no hit
	if (hit.IsValid())
	{
		dist = hit.hitDistance;
	}

	_Output[pixel.y * _SamplesH + pixel.x] = dist;
}

// Include the shared dispatch infrastructure
#include "ComputeRaygenShaderLocal.hlsl"

Key URT rules:

  • #pragma kernel declarations must be in the root .compute file, not in .hlsl includes
  • Group sizes: 16×8 for 2D patterns (cameras, standard lidar), 64×1 for 1D patterns (Livox)
  • ComputeRaygenShaderLocal.hlsl provides MainRayGenShader and ComputeIndirectDispatchDims implementations
  • Only supported on d3d11, vulkan, metal renderers
Option C: Surface/Fragment Shader

Create Assets/Resources/Shader/MySensorShader.shader:

hlsl
/*
 * Copyright (c) 2026 LG Electronics Inc.
 *
 * SPDX-License-Identifier: MIT
 */

Shader "Sensor/MySensorShader"
{
	Properties
	{
		_MainTex ("Main Texture", 2D) = "white" {}
		_MyParam ("My Parameter", Float) = 1.0
	}
	SubShader
	{
		Tags { "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" }

		Pass
		{
			HLSLPROGRAM
			#pragma vertex vert
			#pragma fragment frag

			#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"

			CBUFFER_START(UnityPerMaterial)
				float _MyParam;
			CBUFFER_END

			TEXTURE2D(_MainTex);
			SAMPLER(sampler_MainTex);

			struct Attributes
			{
				float4 positionOS : POSITION;
				float2 uv         : TEXCOORD0;
			};

			struct Varyings
			{
				float2 uv         : TEXCOORD0;
				float4 positionCS : SV_POSITION;
			};

			Varyings vert(Attributes IN)
			{
				Varyings OUT;
				OUT.positionCS = TransformObjectToHClip(IN.positionOS.xyz);
				OUT.uv = IN.uv;
				return OUT;
			}

			half4 frag(Varyings IN) : SV_Target
			{
				half4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, IN.uv);
				color.rgb *= _MyParam;
				return color;
			}
			ENDHLSL
		}
	}
}
Using Shaders in Camera-Based Sensors

For post-processing on camera sensors, use CommandBuffer blits:

csharp
// In a Camera sensor device:
private Material _myMaterial;
private CommandBuffer _cmdBuffer;

private void SetupShader()
{
	var shader = Shader.Find("Sensor/MySensorShader");
	_myMaterial = new Material(shader);
	_myMaterial.SetFloat("_MyParam", 1.0f);

	_cmdBuffer = new CommandBuffer { name = "MySensorEffect" };
	_cmdBuffer.Blit(BuiltinRenderTextureType.CurrentActive, targetRT, _myMaterial);
	_camera.AddCommandBuffer(CameraEvent.AfterEverything, _cmdBuffer);
}
AsyncGPUReadback Integration

All GPU data reads must use AsyncGPUReadback — never synchronous reads:

csharp
AsyncGPUReadback.Request(_outputBuffer, (request) =>
{
	if (request.hasError)
		return;

	var data = request.GetData<float>();
	// Process data, enqueue message
	EnqueueMessage(data);
});

Naming Conventions

ElementConventionExample
Shader properties_PascalCase with underscore prefix_DepthMax, _BaseColor
Kernel namesPascalCase with CS prefix for computeCSScaleDepthBuffer
Defines / macrosUPPER_SNAKE_CASETHREADS, MAX_RANGE_16BITS
Local variablescamelCasepackWidth, depthValue
Inline helpersPascalCaseGetPackWidth(), Pack4Bytes()

Checklist

  • Shader placed in Assets/Resources/Shader/
  • URP compatible: Tags { "RenderPipeline" = "UniversalPipeline" } (surface shaders)
  • Uses HLSLPROGRAM/ENDHLSL (not CGPROGRAM/ENDCG)
  • Uses CBUFFER_START/CBUFFER_END for uniforms (surface shaders)
  • Uses cbuffer for compute shader parameters
  • #define THREADS and #define GROUPS at top of compute shaders
  • inline on small utility functions
  • All GPU readbacks use AsyncGPUReadback
  • Tab indentation, K&R braces
  • License header on file

© lge-ros2, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/add-compute-shader of lge-ros2/cloisim.

Open the folder on GitHubat commit f4c1f0b

Compare with similar skills

Add Compute Shader next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Compute Shader compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Compute Shader this skilllge-ros2/cloisim176—~2.1kAutomated safety check: PassMIT
PixijsRSamaium/CanvasEngine4012 repos~1.6kAutomated safety check: PassMIT
New ExperimentTresjs/tres3.8k—~782Automated safety check: PassMIT
Assets Shader List AllIvanMurzak/Unity-MCP4.4k—~435Automated safety check: PassApache-2.0
Handle Sdr Tonemap Lutclshortfuse/renodx4.5k—~7.3kAutomated safety check: PassMIT
Unreal Material and VFX Workflowflopperam/unreal-engine-mcp1.1k—~927Automated safety check: PassNone

Similar skills

  • Pixijs

    RSamaium/CanvasEngine

    Use this skill first for ANY PixiJS v8 task; it routes to the right specialized skill for the job.

    401 GitHub starsUsed in 2 repos~1.6k tokens
    Game DevelopmentAuto-check passed
  • New Experiment

    Tresjs/tres

    Create a new experiment in TresJS Lab with all necessary files

    3.8k GitHub stars~782 tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Assets Shader List All

    IvanMurzak/Unity-MCP

    List all shaders available in the project assets and packages, sorted by name.

    4.4k GitHub stars~435 tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Handle Sdr Tonemap Lut

    clshortfuse/renodx

    RenoDX HLSL/Slang shader workflow for proven shader-side SDR tonemap, hard clip, LUT, color grade, and HDR bridge changes.

    4.5k GitHub stars~7.3k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Unreal Material and VFX Workflow

    flopperam/unreal-engine-mcp

    Walks an Unreal Engine MCP agent through building materials, Niagara particle systems, Chaos destruction, and curve assets with inspect-then-edit steps.

    1.1k GitHub stars~927 tokensUpdated 3 mo ago
    Game DevelopmentAuto-check passed
  • Rdc CLI

    BANANASJIM/rdc-cli

    A skill your agent uses when working with RenderDoc capture files (.rdc), analyzing GPU frames, tracing shaders, inspecting draw calls, or running CI assertions against GPU captures.

    182 GitHub stars~2.9k tokensUpdated 2 days ago
    Game DevelopmentAuto-check passed

More from lge-ros2/cloisim

All 18 skills in this repo
  • Add Actor Animation

    lge-ros2/cloisim

    Add or modify SDF actors with skeletal animation and waypoint-based navigation.

    176 GitHub stars~2.4k tokensUpdated 5 days ago
    Auto-check passed
  • Add Mesh Import

    lge-ros2/cloisim

    Import 3D mesh files into CLOiSim via the Assimp pipeline, including collision generation and procedural meshes.

    176 GitHub stars~2k tokensUpdated 5 days ago
    Auto-check passed
  • Add Motor Controller

    lge-ros2/cloisim

    Add a new motor or drive controller for robot locomotion. An agent skill from lge-ros2/cloisim.

    176 GitHub stars~1.4k tokensUpdated 5 days ago
    Auto-check passed
  • Add New Plugin

    lge-ros2/cloisim

    Add a new CLOiSimPlugin for bridging a device to the ROS 2 transport layer.

    176 GitHub stars~1.5k tokensUpdated 5 days ago
    Auto-check passed
  • Add New Sensor

    lge-ros2/cloisim

    Add a new sensor device to CLOiSim, including the Device subclass, SDF pipeline wiring, and transport plugin.

    176 GitHub stars~1.6k tokensUpdated 5 days ago
    Auto-check passed
  • Add Noise Model

    lge-ros2/cloisim

    Add a custom noise model for sensor data simulation. An agent skill from lge-ros2/cloisim.

    176 GitHub stars~1.5k tokensUpdated 5 days ago
    Auto-check passed

Questions about Add Compute Shader

What does Add Compute Shader do?

Add a new compute or surface shader for sensor data processing or visualization. Add Compute Shader is an agent skill from lge-ros2/cloisim. Add a new compute or surface shader for sensor data processing or visualization.

When should I use Add Compute Shader?

Add Compute Shader fits situations like: : implementing GPU-side sensor processing; adding a new visual effect; creating a ray tracing shader for a sensor.

How do I install Add Compute Shader in Claude Code?

Run `npx skills add lge-ros2/cloisim --skill add-compute-shader -a claude-code`. Or copy the skill folder (.github/skills/add-compute-shader in lge-ros2/cloisim) into .claude/skills/add-compute-shader in your project. Claude Code loads it when a task matches its description.

How do I install Add Compute Shader in Codex?

Run `npx skills add lge-ros2/cloisim --skill add-compute-shader -a codex`. Or copy the skill folder (.github/skills/add-compute-shader in lge-ros2/cloisim) into .agents/skills/add-compute-shader in your project. Codex loads it when a task matches its description.

Can I use Add Compute Shader in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lge-ros2/cloisim --skill add-compute-shader -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-compute-shader, .gemini/skills/add-compute-shader, .github/skills/add-compute-shader and .opencode/skills/add-compute-shader in your project.

What does Add Compute Shader need to run?

SKILL.md names no scripts, command-line tools or credentials: Add Compute Shader is instructions for the agent only.

Does Add Compute Shader access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Compute Shader safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Compute Shader use?

Add Compute Shader is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Compute Shader use?

About 2.1k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Compute Shader?

Skills that share tags, products or a category with Add Compute Shader: Pixijs (RSamaium/CanvasEngine, 401 stars), New Experiment (Tresjs/tres, 3.8k stars), Assets Shader List All (IvanMurzak/Unity-MCP, 4.4k stars) and Handle Sdr Tonemap Lut (clshortfuse/renodx, 4.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Compute Shader?

lge-ros2 (a GitHub organization) maintains it in lge-ros2/cloisim, which has 176 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on October 6, 2026.

Source: lge-ros2/cloisim on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.