Forge Environment Mapping logo

Forge Environment Mapping

Community
Nebulavenus
forge-environment-mapping

Add cube map environment mapping with a skybox and reflective surfaces. Use when someone needs a 360-degree background, reflection mapping, or cube map textures in SDL3 GPU.

Overview

PublisherNebulavenus
Repositoryforge-gpu
Skill nameforge-environment-mapping
Stars
46
Forks
7
Bundled files
Instructions only
LicenseZlib
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Nebulavenus on GitHub. Read the source before you install it.

Installation

Install the Forge Environment Mapping AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-environment-mapping
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Nebulavenus/forge-gpu.git /tmp/forge-gpu
mkdir -p .claude/skills
cp -r /tmp/forge-gpu/.claude/skills/forge-environment-mapping .claude/skills/forge-environment-mapping
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Forge Environment Mapping in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Forge Environment Mapping on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Forge Environment Mapping is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Environment Mapping — SDL3 GPU Skill

Add a cube map skybox and environment reflections to a 3D scene.

When to use this skill

  • Rendering a 360-degree background (space, sky, indoor environment)
  • Adding reflections to metallic or glossy surfaces
  • Working with SDL_GPU_TEXTURETYPE_CUBE textures
  • Combining multiple graphics pipelines in one render pass

Cube map texture creation

c
/* Create a cube map texture with 6 faces. */
SDL_GPUTextureCreateInfo tex_info;
SDL_zero(tex_info);
tex_info.type                 = SDL_GPU_TEXTURETYPE_CUBE;
tex_info.format               = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB;
tex_info.usage                = SDL_GPU_TEXTUREUSAGE_SAMPLER;
tex_info.width                = face_size;
tex_info.height               = face_size;
tex_info.layer_count_or_depth = 6;  /* MUST be 6 for cube maps */
tex_info.num_levels           = 1;

SDL_GPUTexture *cubemap = SDL_CreateGPUTexture(device, &tex_info);

/* Upload each face as a separate layer (0=+X, 1=-X, 2=+Y, 3=-Y, 4=+Z, 5=-Z). */
for (int face = 0; face < 6; face++) {
    /* Load face image, convert to ABGR8888, map transfer buffer... */

    SDL_GPUTextureRegion dst;
    SDL_zero(dst);
    dst.texture = cubemap;
    dst.layer   = (Uint32)face;  /* Face index = layer index */
    dst.w       = face_size;
    dst.h       = face_size;
    dst.d       = 1;

    SDL_UploadToGPUTexture(copy_pass, &src, &dst, false);
}

Skybox rendering pattern

Vertex shader — depth = 1.0

hlsl
cbuffer VertUniforms : register(b0, space1)
{
    column_major float4x4 vp_no_translation;
};

struct VSOutput
{
    float4 clip_pos  : SV_Position;
    float3 direction : TEXCOORD0;
};

VSOutput main(VSInput input)
{
    VSOutput output;
    output.direction = input.position;

    float4 pos = mul(vp_no_translation, float4(input.position, 1.0));
    output.clip_pos = pos.xyww;  /* z = w → depth = 1.0 after divide */

    return output;
}

Fragment shader — sample cube map

hlsl
TextureCube  skybox_tex : register(t0, space2);
SamplerState smp        : register(s0, space2);

float4 main(PSInput input) : SV_Target
{
    return skybox_tex.Sample(smp, input.direction);
}

Pipeline settings

c
/* Cull FRONT faces — we're inside the cube. */
pipe_info.rasterizer_state.cull_mode = SDL_GPU_CULLMODE_FRONT;

/* Depth test LESS_OR_EQUAL to pass at depth=1.0.
 * Depth write DISABLED — skybox should never occlude anything. */
pipe_info.depth_stencil_state.enable_depth_test  = true;
pipe_info.depth_stencil_state.enable_depth_write = false;
pipe_info.depth_stencil_state.compare_op = SDL_GPU_COMPAREOP_LESS_OR_EQUAL;

Rotation-only view matrix

c
/* Strip translation so the skybox always surrounds the camera. */
mat4 view_rot = view;
view_rot.m[12] = 0.0f;
view_rot.m[13] = 0.0f;
view_rot.m[14] = 0.0f;
mat4 vp_sky = mat4_multiply(proj, view_rot);

Reflection mapping pattern

Fragment shader with reflections

hlsl
TextureCube env_tex : register(t1, space2);

/* Compute reflection direction */
float3 V = normalize(eye_pos.xyz - world_pos);
float3 R = reflect(-V, N);
float3 env_color = env_tex.Sample(env_smp, R).rgb;

/* Blend diffuse with environment reflection */
float3 blended = lerp(surface_color.rgb, env_color, reflectivity);

Render order

  1. Clear depth to 1.0
  2. Draw skybox (depth write off, passes at depth=1.0)
  3. Draw objects (depth write on, depth < 1.0 always passes)

Common mistakes

  1. Forgetting layer_count_or_depth = 6 — cube maps require exactly 6 layers. Without this, texture creation fails silently or renders black.

  2. Wrong face order — SDL_GPUCubeMapFace enum order is +X, -X, +Y, -Y, +Z, -Z. Mixing up faces produces seams or incorrect reflections.

  3. Depth write enabled on skybox — the skybox writes depth=1.0 everywhere, occluding all subsequent geometry. Always disable depth write for the skybox.

  4. Using full view matrix for skybox — includes camera translation, causing visible parallax when moving. Strip translation columns (m[12], m[13], m[14]).

  5. Wrong cull mode for skybox — the camera is inside the cube, so front faces point inward (toward the camera). Cull front faces, not back faces.

  6. Not negating V in reflect() — reflect() expects the incident vector pointing toward the surface. The view direction V points away from the surface, so pass -V.

File layout

text
shaders/
├── skybox.vert.hlsl      # Unit cube → clip space with depth=1.0
├── skybox.frag.hlsl      # Sample TextureCube
├── object.vert.hlsl      # Standard MVP + model (same as lighting)
└── object.frag.hlsl      # Blinn-Phong + reflect() + cube map sample

References

Frequently asked questions

What does the Forge Environment Mapping AI skill do?

Add cube map environment mapping with a skybox and reflective surfaces. Use when someone needs a 360-degree background, reflection mapping, or cube map textures in SDL3 GPU.

Why use Forge Environment Mapping on TypingMind?

Because you install it once and use it with any model. Forge Environment Mapping is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Forge Environment Mapping in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-environment-mapping. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Forge Environment Mapping?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Forge Environment Mapping?

As many as you like. As long as a model supports skills, you can use Forge Environment Mapping with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Forge Environment Mapping AI skill free?

Yes. It is published on GitHub by Nebulavenus under the Zlib license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇