[{"data":1,"prerenderedAt":608},["ShallowReactive",2],{"navigation_docs":3,"-tutorials-first-texture":148,"-tutorials-first-texture-surround":605},[4,21,62,108],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":20},"Tutorials","i-lucide-graduation-cap","\u002Ftutorials","1.tutorials",[10,15],{"title":11,"path":12,"stem":13,"icon":14},"Your first texture","\u002Ftutorials\u002Ffirst-texture","1.tutorials\u002F1.first-texture","i-lucide-sprout",{"title":16,"path":17,"stem":18,"icon":19},"Grow a crop through its stages","\u002Ftutorials\u002Fgrowth-stages","1.tutorials\u002F2.growth-stages","i-lucide-wheat",false,{"title":22,"icon":23,"path":24,"stem":25,"children":26,"page":20},"How-to guides","i-lucide-wrench","\u002Fhow-to","2.how-to",[27,32,37,42,47,52,57],{"title":28,"path":29,"stem":30,"icon":31},"Install TextureScript","\u002Fhow-to\u002Finstall","2.how-to\u002F1.install","i-lucide-download",{"title":33,"path":34,"stem":35,"icon":36},"Compare a crop with vanilla","\u002Fhow-to\u002Fcompare-with-vanilla","2.how-to\u002F2.compare-with-vanilla","i-lucide-columns-2",{"title":38,"path":39,"stem":40,"icon":41},"Connect an agent","\u002Fhow-to\u002Fconnect-an-agent","2.how-to\u002F3.connect-an-agent","i-lucide-bot",{"title":43,"path":44,"stem":45,"icon":46},"Hand-edit a growth stage","\u002Fhow-to\u002Fhand-edit-a-stage","2.how-to\u002F4.hand-edit-a-stage","i-lucide-pencil",{"title":48,"path":49,"stem":50,"icon":51},"Turn a PNG into a grid","\u002Fhow-to\u002Fimport-a-png","2.how-to\u002F5.import-a-png","i-lucide-file-image",{"title":53,"path":54,"stem":55,"icon":56},"Prove a fix stayed in its region","\u002Fhow-to\u002Fprove-a-fix","2.how-to\u002F6.prove-a-fix","i-lucide-diff",{"title":58,"path":59,"stem":60,"icon":61},"Keep game assets out of git","\u002Fhow-to\u002Fkeep-game-assets-out","2.how-to\u002F7.keep-game-assets-out","i-lucide-shield-check",{"title":63,"icon":64,"path":65,"stem":66,"children":67,"page":20},"Reference","i-lucide-book-open","\u002Freference","3.reference",[68,73,78,83,88,93,98,103],{"title":69,"path":70,"stem":71,"icon":72},"Commands","\u002Freference\u002Fcommands","3.reference\u002F1.commands","i-lucide-terminal",{"title":74,"path":75,"stem":76,"icon":77},"Palette files","\u002Freference\u002Fpalette-files","3.reference\u002F2.palette-files","i-lucide-palette",{"title":79,"path":80,"stem":81,"icon":82},"Grid files","\u002Freference\u002Fgrid-files","3.reference\u002F3.grid-files","i-lucide-grid-3x3",{"title":84,"path":85,"stem":86,"icon":87},"Stages files","\u002Freference\u002Fstages-files","3.reference\u002F4.stages-files","i-lucide-layers",{"title":89,"path":90,"stem":91,"icon":92},"Scene files","\u002Freference\u002Fscene-files","3.reference\u002F5.scene-files","i-lucide-box",{"title":94,"path":95,"stem":96,"icon":97},"Lint rules","\u002Freference\u002Flint-rules","3.reference\u002F6.lint-rules","i-lucide-list-checks",{"title":99,"path":100,"stem":101,"icon":102},"MCP server","\u002Freference\u002Fmcp-server","3.reference\u002F7.mcp-server","i-lucide-plug",{"title":104,"path":105,"stem":106,"icon":107},"Environment","\u002Freference\u002Fenvironment","3.reference\u002F8.environment","i-lucide-settings",{"title":109,"icon":110,"path":111,"stem":112,"children":113,"page":20},"Explanation","i-lucide-lightbulb","\u002Fexplanation","4.explanation",[114,119,123,128,133,138,143],{"title":115,"path":116,"stem":117,"icon":118},"Textures as text","\u002Fexplanation\u002Ftextures-as-text","4.explanation\u002F1.textures-as-text","i-lucide-type",{"title":120,"path":121,"stem":122,"icon":77},"Colour from two anchors","\u002Fexplanation\u002Fcolour","4.explanation\u002F2.colour",{"title":124,"path":125,"stem":126,"icon":127},"Measured conventions","\u002Fexplanation\u002Fmeasured-conventions","4.explanation\u002F3.measured-conventions","i-lucide-ruler",{"title":129,"path":130,"stem":131,"icon":132},"Growth stages as maps","\u002Fexplanation\u002Fgrowth-stages","4.explanation\u002F4.growth-stages","i-lucide-chart-no-axes-column-increasing",{"title":134,"path":135,"stem":136,"icon":137},"The 3D view","\u002Fexplanation\u002Fthe-3d-view","4.explanation\u002F5.the-3d-view","i-lucide-rotate-3d",{"title":139,"path":140,"stem":141,"icon":142},"No game assets","\u002Fexplanation\u002Fno-game-assets","4.explanation\u002F6.no-game-assets","i-lucide-shield",{"title":144,"path":145,"stem":146,"icon":147},"Architecture","\u002Fexplanation\u002Farchitecture","4.explanation\u002F7.architecture","i-lucide-boxes",{"id":149,"title":11,"body":150,"description":598,"extension":599,"links":600,"meta":601,"navigation":602,"path":12,"seo":603,"stem":13,"__hash__":604},"docs\u002F1.tutorials\u002F1.first-texture.md",{"type":151,"value":152,"toc":588},"minimark",[153,174,189,194,210,214,222,229,237,254,260,269,275,281,288,292,305,311,314,318,327,333,339,361,367,371,377,383,386,390,399,405,424,428,434,441,448,459,465,520,526,529,538,544,550,553,562,568,572,578,584],[154,155,156,157,161,162,165,166,169,170,173],"p",{},"In this tutorial you draw a small single-block plant, a sprout, from nothing. Along the way you\nwill use the four commands that make up nearly every TextureScript session: ",[158,159,160],"code",{},"palette",", ",[158,163,164],{},"grid",",\n",[158,167,168],{},"lint"," and ",[158,171,172],{},"shoot",".",[154,175,176,177,180,181,184,185,188],{},"You need ",[158,178,179],{},"texturescript"," on your ",[158,182,183],{},"PATH"," (see ",[186,187,28],"a",{"href":29},"). You do\nnot need Minecraft: everything here works without a game jar.",[190,191,193],"h2",{"id":192},"make-a-folder","Make a folder",[195,196,201],"pre",{"className":197,"code":198,"language":199,"meta":200,"style":200},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","mkdir sprout && cd sprout\n","sh","",[158,202,203],{"__ignoreMap":200},[204,205,208],"span",{"class":206,"line":207},"line",1,[204,209,198],{},[190,211,213],{"id":212},"choose-the-colours","Choose the colours",[154,215,216,217,221],{},"A texture's colours come from a ",[218,219,220],"strong",{},"palette file",". You do not pick every shade: you pick a dark\nand a light anchor for each material and say how many shades you want. TextureScript fills in\nthe rest.",[154,223,224,225,228],{},"Create ",[158,226,227],{},"sprout.palette",":",[195,230,235],{"className":231,"code":233,"filename":227,"language":234,"meta":200},[232],"language-text","material leaf  dark #266325  light #55ab2d  shades 4  keys abcd\ntransparent .\n","text",[158,236,233],{"__ignoreMap":200},[154,238,239,240,243,244,246,247,250,251,253],{},"This declares one material, ",[158,241,242],{},"leaf",", with four shades named ",[158,245,186],{}," (darkest) to ",[158,248,249],{},"d"," (lightest), and\nuses ",[158,252,173],{}," for empty pixels. The two anchors are vanilla's own crop-leaf greens.",[154,255,256,257,259],{},"Run ",[158,258,160],{}," to derive the shades:",[195,261,263],{"className":197,"code":262,"language":199,"meta":200,"style":200},"texturescript palette sprout.palette --out palette.txt --swatch swatch.png\n",[158,264,265],{"__ignoreMap":200},[204,266,267],{"class":206,"line":207},[204,268,262],{},[154,270,271,274],{},[158,272,273],{},"palette.txt"," now holds the palette section of a grid:",[195,276,279],{"className":277,"code":278,"filename":273,"language":234,"meta":200},[232],"palette\n. transparent\n# leaf: 4 shades #266325 -> #55ab2d\n# leaf: dark L44 C11 h143, light L66 C18 h138; vanilla foliage: dark L31-57, light L45-79, chroma \u003C= 24\na #266325\nb #347a2a\nc #43922d\nd #55ab2d\n",[158,280,278],{"__ignoreMap":200},[154,282,283,284,287],{},"The comment lines compare your anchors with the range measured on vanilla foliage. Both sit\ninside it, so there is no warning. Open ",[158,285,286],{},"swatch.png"," if you want to see the four shades.",[190,289,291],{"id":290},"draw-the-grid","Draw the grid",[154,293,294,295,297,298,301,302,304],{},"A grid file is the palette section followed by ",[158,296,164],{}," and 16 rows of 16 characters. Create\n",[158,299,300],{},"sprout.grid"," by pasting ",[158,303,273],{}," and then drawing below it:",[195,306,309],{"className":307,"code":308,"filename":300,"language":234,"meta":200},[232],"palette\n. transparent\n# leaf: 4 shades #266325 -> #55ab2d\n# leaf: dark L44 C11 h143, light L66 C18 h138; vanilla foliage: dark L31-57, light L45-79, chroma \u003C= 24\na #266325\nb #347a2a\nc #43922d\nd #55ab2d\ngrid\n................\n................\n................\n................\n................\n.......dd.......\n......dccd......\n..d...dcc...d...\n..cd...cb..dc...\n...cd..bb.dc....\n....cc.bb.cb....\n.....cbbbcb.....\n......bbbb......\n.......bb.......\n.......aa.......\n.......aa.......\n",[158,310,308],{"__ignoreMap":200},[154,312,313],{},"Notice the shape: a two-pixel stem on columns 7 and 8 that darkens towards the soil, two leaves\nstepping up and out from it, and lighter shades at the top. The bottom row is the soil line, so\nthe stem touches it.",[190,315,317],{"id":316},"render-it","Render it",[195,319,321],{"className":197,"code":320,"language":199,"meta":200,"style":200},"texturescript grid sprout.grid out\u002Fsprout.png\n",[158,322,323],{"__ignoreMap":200},[204,324,325],{"class":206,"line":207},[204,326,320],{},[195,328,331],{"className":329,"code":330,"language":234,"meta":200},[232],"rendered out\u002Fsprout.png (16x16, 5 palette entries)\n",[158,332,330],{"__ignoreMap":200},[154,334,335,336,228],{},"Three files appear in ",[158,337,338],{},"out\u002F",[340,341,342,349,355],"ul",{},[343,344,345,348],"li",{},[158,346,347],{},"sprout.png",", the 16×16 texture itself;",[343,350,351,354],{},[158,352,353],{},"sprout_x16.png",", the same image enlarged sixteen times, for looking at;",[343,356,357,360],{},[158,358,359],{},"sprout.txt",", the grid as ASCII, for checking pixel positions exactly.",[154,362,363,364,366],{},"Open ",[158,365,353],{},". This is how you judge shape.",[190,368,370],{"id":369},"see-what-a-mistake-looks-like","See what a mistake looks like",[154,372,373,374,376],{},"Delete one dot from row 10 of ",[158,375,300],{},", so the row is 15 characters wide, and render again:",[195,378,381],{"className":379,"code":380,"language":234,"meta":200},[232],"REFUSED sprout.grid:20: row is 15 wide, expected 16 like the first row\n",[158,382,380],{"__ignoreMap":200},[154,384,385],{},"TextureScript names the file and line and writes nothing. A wrong row width is the most common\nrefusal, so get used to counting characters. Put the dot back.",[190,387,389],{"id":388},"lint-it","Lint it",[195,391,393],{"className":197,"code":392,"language":199,"meta":200,"style":200},"texturescript lint out\u002Fsprout.png --palette sprout.palette\n",[158,394,395],{"__ignoreMap":200},[204,396,397],{"class":206,"line":207},[204,398,392],{},[195,400,403],{"className":401,"code":402,"language":234,"meta":200},[232],"OK   alpha     binary\nOK   budget    4 colours\nOK   palette   all colours are palette shades; leaf 4\nOK   noise     isolated-pixel fraction 0.067 (fail above 0.5) at (11,9) (10,10) (9,11)\nOK   coverage  18% opaque\nOK   outline   no outline, as for vanilla crops\nPASSED: 0 fail, 0 warn\n",[158,404,402],{"__ignoreMap":200},[154,406,407,408,411,412,415,416,419,420,423],{},"Each line is a rule measured on vanilla textures. ",[158,409,410],{},"--palette"," adds a check that every colour\ncomes from your palette. A ",[218,413,414],{},"FAIL"," must be fixed; a ",[218,417,418],{},"WARN"," is a question worth asking. The\nsprout passes everything. The ",[186,421,422],{"href":95},"lint rules"," page lists them all.",[190,425,427],{"id":426},"look-at-it-in-3d","Look at it in 3D",[154,429,430,431,173],{},"A flat sprite is not what the player sees. In the game a plant is drawn on crossing planes, so it\noverlaps itself. To see that, describe a tiny ",[218,432,433],{},"scene",[154,435,436,437,440],{},"First, a ",[158,438,439],{},".stages"," file that turns the grid into a one-stage crop:",[195,442,446],{"className":443,"code":444,"filename":445,"language":234,"meta":200},[232],"palette sprout.palette\ngrid lower sprout.grid\nstages 1\nmap lower\n................\n................\n................\n................\n................\n.......00.......\n......0000......\n..0...000...0...\n..00...00..00...\n...00..00.00....\n....00.00.00....\n.....000000.....\n......0000......\n.......00.......\n.......00.......\n.......00.......\n","sprout.stages",[158,447,444],{"__ignoreMap":200},[154,449,450,451,454,455,458],{},"The map marks every opaque pixel with the stage at which it appears; with one stage, that is\nalways ",[158,452,453],{},"0",". The ",[186,456,457],{"href":17},"growth stages tutorial"," does this properly.",[154,460,461,462,228],{},"Then the scene, ",[158,463,464],{},"sprout.toml",[195,466,470],{"className":467,"code":468,"filename":464,"language":469,"meta":200,"style":200},"language-toml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","camera = { yaw = 30, pitch = 22, distance = 5 }\nfloor = \"minecraft:grass_block\"\n\n[[plot]]\nlabel = \"sprout\"\nstages = \"sprout.stages\"\nmodel = \"cross\"\nat = [0, 0]\n","toml",[158,471,472,477,483,490,496,502,508,514],{"__ignoreMap":200},[204,473,474],{"class":206,"line":207},[204,475,476],{},"camera = { yaw = 30, pitch = 22, distance = 5 }\n",[204,478,480],{"class":206,"line":479},2,[204,481,482],{},"floor = \"minecraft:grass_block\"\n",[204,484,486],{"class":206,"line":485},3,[204,487,489],{"emptyLinePlaceholder":488},true,"\n",[204,491,493],{"class":206,"line":492},4,[204,494,495],{},"[[plot]]\n",[204,497,499],{"class":206,"line":498},5,[204,500,501],{},"label = \"sprout\"\n",[204,503,505],{"class":206,"line":504},6,[204,506,507],{},"stages = \"sprout.stages\"\n",[204,509,511],{"class":206,"line":510},7,[204,512,513],{},"model = \"cross\"\n",[204,515,517],{"class":206,"line":516},8,[204,518,519],{},"at = [0, 0]\n",[154,521,522,525],{},[158,523,524],{},"model = \"cross\""," plants the sprite on two diagonal planes, like a sapling or a flower.",[154,527,528],{},"Take two screenshots from different angles:",[195,530,532],{"className":197,"code":531,"language":199,"meta":200,"style":200},"texturescript shoot sprout.toml out\u002Fshot.png --cam 30,22,4 --cam 120,10,4\n",[158,533,534],{"__ignoreMap":200},[204,535,536],{"class":206,"line":207},[204,537,531],{},[195,539,542],{"className":540,"code":541,"language":234,"meta":200},[232],"out\u002Fshot.png: 2 shots (1 variant × 2 cameras)\n",[158,543,541],{"__ignoreMap":200},[154,545,363,546,549],{},[158,547,548],{},"out\u002Fshot.png",". If you have no Minecraft installed, the grass floor is listed as missing and\nyour sprout floats on sky; that is expected. With the game installed, it stands on grass.",[154,551,552],{},"If you can see a browser, try the live view instead:",[195,554,556],{"className":197,"code":555,"language":199,"meta":200,"style":200},"texturescript view sprout.toml\n",[158,557,558],{"__ignoreMap":200},[204,559,560],{"class":206,"line":207},[204,561,555],{},[154,563,564,565,567],{},"Leave it running, change a leaf in ",[158,566,300],{}," and save. The sprout in the browser changes in\nplace.",[190,569,571],{"id":570},"what-you-have-learned","What you have learned",[154,573,574,575,577],{},"You chose two anchors and let ",[158,576,160],{}," derive the shades, drew a grid with those keys, rendered\nit, read a refusal, linted the result and judged it on the block model. That loop of draw,\nrender, lint and look is the whole method.",[154,579,580,581,173],{},"Next, ",[186,582,583],{"href":17},"grow a crop through its stages",[585,586,587],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":200,"searchDepth":479,"depth":479,"links":589},[590,591,592,593,594,595,596,597],{"id":192,"depth":479,"text":193},{"id":212,"depth":479,"text":213},{"id":290,"depth":479,"text":291},{"id":316,"depth":479,"text":317},{"id":369,"depth":479,"text":370},{"id":388,"depth":479,"text":389},{"id":426,"depth":479,"text":427},{"id":570,"depth":479,"text":571},"Draw a small plant as a character grid, render it, lint it and look at it in 3D.","md",null,{},{"icon":14},{"title":11,"description":598},"sb5ZkwCvj9jnxkjw38-tu75E4FAvO2rChy5wlOcindc",[600,606],{"title":16,"path":17,"stem":18,"description":607,"icon":19,"children":-1},"Take the finished corn example, generate its eight growth stages, change when the ear appears and compare it with vanilla wheat in 3D.",1791722217440]