Logo vun Forge Environment Mapping

Forge Environment Mapping

Communautéit
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.

Iwwersiicht

EditeurNebulavenus
Repositoryforge-gpu
Skill-Nummforge-environment-mapping
Stären
46
Forks
7
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzZlib
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum Nebulavenus op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Forge Environment Mapping an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-environment-mapping
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Forge Environment Mapping an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Forge Environment Mapping automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Forge Environment Mapping net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Forge Environment Mapping op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Forge Environment Mapping besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Forge Environment Mapping an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-environment-mapping an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Forge Environment Mapping benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Forge Environment Mapping benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Forge Environment Mapping domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Forge Environment Mapping gratis?

Jo. De Skill gëtt vum Nebulavenus ënner der Lizenz Zlib op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇