feat: texture painter experiment with per-texture canvas editors#88
Open
cnotv wants to merge 10 commits into
Open
feat: texture painter experiment with per-texture canvas editors#88cnotv wants to merge 10 commits into
cnotv wants to merge 10 commits into
Conversation
- Extract buildMaterial to src/utils/materialBuilder.ts shared utility - Create TexturePainter view: sphere preview with all material controls - Per-texture CanvasEditor with limited 2-4 color palette per slot - Textures persisted to localStorage via storageSaveLocal - Remove overflow from PanelContainer except on mobile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for cnotv-generative-art ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- Add overflow-y: auto to .sheet-content so panels scroll on desktop - Move maps toggles to Scene panel via registerSceneConfig, reducing Config panel height so texture editors are visible without scrolling Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace panel CanvasEditor with direct sphere painting - Raycast mouse position to sphere UV coordinates, draw strokes on the corresponding offscreen canvas, set needsUpdate on the texture - Config panel: Mode toggle (Paint/Rotate), texture slot selector, colour picker, brush size slider - In Paint mode: left-click drag on sphere paints; cursor is crosshair - In Rotate mode: left-click drag on sphere rotates; cursor is grab Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New src/components/DrawingToolbar: reusable icon toolbar with brush, eraser, fill, rotate, color picker, brush size - CanvasEditorTools refactored to use DrawingToolbar for core buttons - TexturePainter: replace Mode text toggle + config sliders with DrawingToolbar via Teleport; toolbar shows texture slot tabs, icon tool buttons, reset buttons - activeTool/brushColor/brushSize are local refs, not schema-driven Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…xtures Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lette - DrawingToolbar: add canUndo/canRedo props + undo/redo icon buttons - TexturePainter strengths group in Config panel (normalScale, aoIntensity, displacementScale, emissiveIntensity, envMapIntensity) applied after buildMaterial to override hardcoded defaults - Per-slot undo/redo history (max 20 steps); pushes on mouseUp after paint - Eraser: uses globalCompositeOperation destination-out - Fill: BFS flood fill at UV hit point - Per-slot palette swatches in toolbar; auto-selects first palette color when switching slots if current color is not in the new slot's palette Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The external getValue/updateValue approach used with registerSceneConfig was not rendering controls. Maps are now part of the view config schema so they use the same working path resolution as other controls. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each preset applies materialType, properties, strengths, maps, and regenerates all six texture slots with matching procedural patterns: - Glass: MeshPhysicalMaterial, transmission=0.95, subtle wave normals - Metal: anisotropic scratches on diffuse/normal/roughness - Rock: sin-wave noise diffuse/normal/displacement, high roughness - Magic: dark sphere with glowing emissive orbs and energy lines - Cutout: circular hole displacement + AO shadow mapping effect Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er-view accordion state
- Remove all presets; keep plain ball with full PBR config controls
- Add image load per texture slot (file input in config panel toolbar)
- Add lake.webp as equirectangular scene background + env map source
- Generate all 6 PBR maps from hyde.webp (Sobel normal, roughness, AO,
displacement) with seamless offset-blend tiling
- Convert lake.heic → lake.webp (149kb), hyde.jpg → hyde.webp (270kb)
- Config panel auto-opens on mount via openPanel('config')
- Per-view accordion default: __defaultOpenGroups in schema; TexturePainter
starts collapsed, other views stay fully open
- Fix __vnode crash: replace canvas function-refs with img+dataURL previews
- Fix config.ts export loss: restore all PAINTER_* and TEXTURE_SLOT_* constants
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #87
Summary
Experiments/TexturePainterview: a 3D sphere with live material preview and per-texture paintingbuildMaterialfromMaterialsList.vueintosrc/utils/materialBuilder.tsshared utilityMaterialsListandTexturePaintershare the same material-building logic without duplicationKey Changes
src/utils/materialBuilder.ts— Shared utility; splits intoapplyTextureParameters+applyMaterialTypeParametershelperssrc/views/Experiments/TexturePainter/config.ts— Re-exports shared constants; adds painter-specific constants (PAINTER_*,TEXTURE_SLOT_*,STORAGE_PREFIX)src/views/Experiments/TexturePainter/TexturePainter.vue— Sphere scene with orthographic camera + orbiting light. Config panel:ButtonSelectorfor material type + property sliders. Maps toggles in Scene panel viaregisterSceneConfig.<Teleport to="#config-panel-extra">injects texture slot selector + colour palette +CanvasEditor; appears immediately below the property sliders. Painted textures backed by offscreen canvases wired asTHREE.CanvasTexture, saved to localStorage. Drag to rotate spheresrc/views/Experiments/MaterialsList/MaterialsList.vue— ImportsbuildMaterialfrom shared utilitysrc/config/viewsMeta.json— Adds"Texture Painter"entrysrc/components/panels/PanelContainer.vue—overflow-y: autoremoved from container (desktop), moved to.sheet-contentso panels scroll independently; mobile keeps container scrollTest Plan
/experiments/TexturePainter— sphere renders with Standard material🤖 Generated with Claude Code