shader-development

A set of coding rules for GLSL shader development, including file organization, naming, edge-case handling, performance, and texture use. Textures are images or data sampled by a shader while drawing.

In plain words
What is it for?
Use it when writing or reviewing vertex and fragment shaders, shared shader includes, texture coordinates, mipmaps, precision choices, and shader mathematics.
Why use it?
It helps keep shader code understandable and reduces avoidable rendering cost from extra conditions, texture lookups, or inefficient calculations.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/hexianweb/third-person-mc/shader-development
Clone the repo
git clone --depth 1 https://github.com/hexianWeb/Third-Person-MC

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 319 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00319
Opus 5 $0.00000 $0.00160
Sonnet 5 $0.00000 $0.00064
Haiku 4.5 $0.00000 $0.00032

Measured 2d ago against content hash 4b8318c5c825, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

shader-development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/shader-development.mdc · 59 lines

What it actually says

Shader Development Guidelines

Code Organization

  • Use clear naming conventions for uniforms and varyings
  • Organize shader code into logical sections (uniforms, varyings, functions, main)
  • Use includes for shared functionality
  • Document complex mathematical operations
  • Keep shader files focused and single-purpose

Performance Optimization

  • Minimize conditional statements in fragment shaders
  • Use built-in GLSL functions when available
  • Optimize vector operations
  • Minimize texture lookups
  • Use appropriate precision qualifiers
  • Avoid dynamic loops where possible
  • Cache repeated calculations

Best Practices

  • Initialize all variables
  • Use appropriate data types
  • Handle edge cases gracefully
  • Implement proper error handling
  • Use preprocessor directives effectively
  • Follow GLSL version compatibility guidelines
  • Document performance implications

Texture Management

  • Use appropriate texture formats
  • Implement proper texture coordinate handling
  • Use texture arrays when appropriate
  • Handle texture boundaries properly
  • Implement proper mipmap usage

Mathematics

  • Use efficient mathematical operations
  • Implement proper interpolation methods
  • Use appropriate coordinate spaces
  • Handle numerical precision issues
  • Document complex mathematical concepts

Debugging

  • Use debug output uniforms
  • Implement visual debugging modes
  • Use appropriate error checking
  • Document known limitations
  • Implement fallbacks for unsupported features

Cross-Platform Compatibility

  • Test on multiple GPU vendors
  • Handle precision differences
  • Use appropriate extensions
  • Document platform-specific issues
  • Implement fallbacks for unsupported features
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 59 lines · 319 tokens per session scan A 4b8318c5c825

Subscribe to this mod's changes

shader-development is a cursor rule published in the GitHub repository hexianWeb/Third-Person-MC (189 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 319 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.