Skip to content

Conversation

@fernandotonon
Copy link
Owner

Summary

  • Enhanced system prompt with comprehensive Ogre3D material syntax reference
  • Added available textures context from Ogre's TextureManager to prompts
  • LLM now knows which textures are available in the project

Changes

Enhanced System Prompt

Added comprehensive documentation for:

  • Pass attributes: ambient, diffuse, specular, emissive, lighting, shading, scene_blend, depth_check, depth_write, cull_hardware, polygon_mode
  • Texture unit attributes: texture, filtering, tex_address_mode, scroll, scroll_anim, rotate, rotate_anim, scale, colour_op, env_map, alpha_rejection
  • Blend operations: colour_op_ex operations and sources
  • Multiple examples: textured material, transparent material, animated water

Available Textures Context

  • Gets list of textures from Ogre's TextureManager when generating materials
  • Filters out internal Ogre textures (RTT, Ogre/, etc.)
  • Limits to 50 textures to avoid excessive prompt length
  • Instructs LLM to only use textures from the available list

Improved Retry Logic

  • Retry prompts now include the available textures list
  • Better error messages with specific validation failure reasons

Benefits

  • LLM generates more valid material scripts
  • Materials reference actual project textures instead of non-existent files
  • Better understanding of Ogre3D material syntax reduces validation failures

Related Issues

Test Plan

  • Build succeeds
  • Load a model with textures
  • Open Material Editor and use AI to generate a material
  • Verify the LLM references actual available textures
  • Verify generated materials are syntactically valid

🤖 Generated with Claude Code

fernandotonon and others added 2 commits January 30, 2026 23:29
…ures

- Enhanced system prompt with comprehensive Ogre3D material attributes:
  - Pass attributes (ambient, diffuse, specular, emissive, lighting, blending, etc.)
  - Texture unit attributes (texture, filtering, addressing, transforms, etc.)
  - Multiple examples (textured, transparent, animated materials)

- Added available textures context to prompts:
  - Gets list of textures from Ogre's TextureManager
  - Filters out internal Ogre textures (RTT, Ogre/, etc.)
  - Instructs LLM to only use textures from the available list
  - Limits to 50 textures to avoid prompt bloat

- Improved retry logic to include texture list on validation failures

This helps the LLM generate valid material scripts that reference
actual project textures rather than non-existent files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Simplified system prompt to focus on basic color operations
- Added explicit rule: "Do NOT add texture_unit unless specifically asked"
- Textures list only included when prompt contains texture-related keywords
  (texture, image, map, .png, .jpg, etc.)
- Clearer color reference with simple RGB values
- Bump version to 2.1.1

This fixes the issue where the LLM was adding unwanted textures
for simple color change requests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants