@babylonjs/mcp-servers 9.26.1 → 9.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nrge-mcp-server.js
CHANGED
|
@@ -79,7 +79,7 @@ data: ${JSON.stringify({reason:r})}
|
|
|
79
79
|
|
|
80
80
|
`);const n=await this._adapter.getDocument(t);n&&this._writeDocumentEvent(r,n),r.on("close",()=>{i.delete(r),this._recordActivity()})}async _handleGetDocumentAsync(t,r){const i=await this._adapter.getDocument(t);if(!i){this._writeJson(r,404,{error:`Document "${t.name}" not found`});return}r.statusCode=200,r.setHeader("Content-Type","application/json; charset=utf-8"),r.setHeader("Cache-Control","no-cache"),r.setHeader("X-Mcp-Editor-Session-Revision",t.revision.toString()),r.end(i)}async _handlePostDocumentAsync(t,r,i){const n=await this._readBodyAsync(r);try{JSON.parse(n)}catch{this._writeJson(i,400,{error:"Invalid JSON"});return}const o=await this._adapter.setDocument(t,n);if(typeof o=="string"&&o.length>0){this._writeJson(i,400,{error:o});return}const a=t.revision;this._touchSession(t),i.setHeader("X-Mcp-Editor-Session-Revision",t.revision.toString()),this._writeJson(i,200,{ok:!0,previousRevision:a,revision:t.revision,conflictPolicy:Yo}),await this._sendDocumentUpdateAsync(t.id,!1)}async _sendDocumentUpdateAsync(t,r=!0){const i=this._sessions.get(t);if(!i)return;this._recordActivity(),r&&this._touchSession(i);const n=this._sseClients.get(t);if(!n||n.size===0)return;const o=await this._adapter.getDocument(i);if(o)for(const a of n)this._writeDocumentEvent(a,o)}_touchSession(t){t.updatedAt=Date.now(),t.revision++}_writeDocumentEvent(t,r){const i=JSON.stringify(JSON.parse(r));t.write(`data: ${i}
|
|
81
81
|
|
|
82
|
-
`)}_isDocumentRoute(t){return t==="document"||this._legacyDocumentRoutes.has(t)}_createSessionInfo(t){const r=this._sseClients.get(t.id)?.size??0,i={sessionId:t.id,kind:t.kind,name:t.name,revision:t.revision,createdAt:t.createdAt,updatedAt:t.updatedAt,conflictPolicy:Yo,subscriberCount:r,eventsUrl:`/session/${t.id}/events`,documentUrl:`/session/${t.id}/document`};for(const n of this._legacyDocumentRoutes)i[`${n}Url`]=`/session/${t.id}/${n}`;return i}_getSessionInfoList(){return[...this._sessions.values()].map(t=>this._createSessionInfo(t))}_getSseClientCount(){let t=0;for(const r of this._sseClients.values())t+=r.size;return t}async _readBodyAsync(t){const r=[];return await new Promise((i,n)=>{t.on("data",o=>r.push(o)),t.on("end",i),t.on("error",n)}),Buffer.concat(r).toString("utf-8")}_writeJson(t,r,i){t.statusCode=r,t.setHeader("Content-Type","application/json; charset=utf-8"),t.end(JSON.stringify(i))}_writeText(t,r,i){t.statusCode=r,t.setHeader("Content-Type","text/plain; charset=utf-8"),t.end(i)}}class Gx{constructor(t,r={}){this._manager=null,this._sessionServer=null,this._adapter=t,this._options=r}isRunning(){return this._sessionServer?.isRunning()??!1}async startAsync(t,r){return this._manager=t,await this._getSessionServer().startAsync(r)}async stopAsync(){this._sessionServer&&await this._sessionServer.stopAsync()}createSession(t){return this._getSessionServer().createSession(t).id}getSessionIdForName(t){return this._sessionServer?.getSessionIdForName(t)}getSessionUrl(t,r){return this._getSessionServer().getSessionUrl(t,r)}notifySessionUpdate(t){this._sessionServer?.notifySessionUpdate(t)}closeSession(t){return this._sessionServer?.closeSession(t)??!1}closeSessionForName(t){return this._sessionServer?.closeSessionForName(t)??!1}getPort(){return this._sessionServer?.getPort()??0}getHealth(){return this._getSessionServer().getHealth()}getDiagnostics(){return this._getSessionServer().getDiagnostics()}_getSessionServer(){return this._sessionServer||(this._sessionServer=new Vx({serverName:this._adapter.serverName,documentKind:this._adapter.documentKind,getDocument:t=>this._manager?this._adapter.getDocument(this._manager,t):void 0,setDocument:(t,r)=>this._manager?this._adapter.setDocument(this._manager,t,r):this._adapter.managerUnavailableMessage??"Document manager is not available"},this._options)),this._sessionServer}}const Kn={NodeRenderGraphInputBlock:{className:"NodeRenderGraphInputBlock",category:"Input",description:"Exposes an external resource to the render graph. The type is determined by `additionalConstructionParameters[0]` (a NodeRenderGraphBlockConnectionPointTypes enum value). Common type values: Texture=1, TextureDepthStencilAttachment=8, Camera=0x01000000, ObjectList=0x02000000, ShadowLight=0x00400000. Set `isExternal=true` so Babylon auto-fills the value from the scene at build time. For texture inputs you must provide `creationOptions` with size/format/samples; use the `set_block_properties` tool to set these fields after adding the block.",inputs:[],outputs:[{name:"output",type:"AutoDetect"}],properties:{isExternal:"boolean \u2013 when true Babylon.js fills the value automatically (cameras, object-lists, lights). Default: false",creationOptions:"FrameGraphTextureCreationOptions JSON \u2013 for texture inputs; defines size, format, samples, etc."},defaultAdditionalConstructionParameters:[1073741824]},NodeRenderGraphOutputBlock:{className:"NodeRenderGraphOutputBlock",category:"Output",description:"The final output block. Every render graph MUST have exactly one. Connect the last rendered texture to the `texture` port. The outputNodeId of the serialised graph must equal this block's id.",inputs:[{name:"texture",type:"Texture",isOptional:!1},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[]},NodeRenderGraphClearBlock:{className:"NodeRenderGraphClearBlock",category:"Textures",description:"Clears a colour texture and/or depth-stencil attachment to a configurable colour / depth value. Both `target` and `depth` are optional, but at least one should be connected. Outputs mirror the connected inputs so downstream blocks can use the cleared textures.",inputs:[{name:"target",type:"AutoDetect",isOptional:!0},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"}],properties:{color:"Color4 {r,g,b,a} \u2013 clear colour (default: {r:0,g:0,b:0,a:1})",clearColor:"boolean \u2013 whether to clear the colour channel (default: true)",clearDepth:"boolean \u2013 whether to clear the depth channel (default: false)",clearStencil:"boolean \u2013 whether to clear the stencil channel (default: false)",convertColorToLinearSpace:"boolean \u2013 convert sRGB clear colour to linear space (default: false)"}},NodeRenderGraphCopyTextureBlock:{className:"NodeRenderGraphCopyTextureBlock",category:"Textures",description:"Copies (blits) one texture into another. Useful for preserving intermediate render results or preparing textures for later read-back.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphGenerateMipmapsBlock:{className:"NodeRenderGraphGenerateMipmapsBlock",category:"Textures",description:"Generates all mip-map levels for a texture in-place after prior rendering has been done. Required for techniques that sample lower mip levels (e.g. bloom, reflections).",inputs:[{name:"target",type:"AutoDetect"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphObjectRendererBlock:{className:"NodeRenderGraphObjectRendererBlock",category:"Rendering",description:"Renders a list of scene objects (meshes, particles) to a colour target using a camera. This is the primary rasterisation block \u2014 almost every graph needs one. Connect a cleared colour texture to `target`, a depth attachment to `depth`, a Camera input to `camera`, and a (possibly culled) ObjectList to `objects`. Optional `shadowGenerators` port accepts a ShadowGenerator or ResourceContainer of shadow generators.",inputs:[{name:"target",type:"AutoDetect"},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0},{name:"shadowGenerators",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"},{name:"objectRenderer",type:"Object"}],properties:{doNotChangeAspectRatio:"boolean \u2013 do not change the aspect ratio of the scene when rendering to RTT (default: true). Set as additionalConstructionParameters[0]",enableClusteredLights:"boolean \u2013 enable clustered light rendering (default: true). Set as additionalConstructionParameters[1]",isMainObjectRenderer:"boolean \u2013 marks this as the main object renderer; only one block should be main per graph. Babylon.js auto-assigns the first one if none is set.",depthTest:"boolean \u2013 enable depth testing (default: true)",depthWrite:"boolean \u2013 enable depth writing (default: true)",disableShadows:"boolean \u2013 disable shadow sampling (default: false)",renderParticles:"boolean \u2013 render particle systems (default: true)",renderSprites:"boolean \u2013 render sprite managers (default: true)"},defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphGeometryRendererBlock:{className:"NodeRenderGraphGeometryRendererBlock",category:"Rendering",description:"Renders scene geometry into a multi-render target (G-Buffer), producing typed geometry textures (view-depth, normals, albedo, reflectivity, positions, velocity, etc.). Use these outputs as inputs for deferred shading techniques such as SSR, SSAO, or custom deferred passes. The `target` port for the colour attachment is OPTIONAL for this block.",inputs:[{name:"target",type:"AutoDetect",isOptional:!0},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0},{name:"shadowGenerators",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"},{name:"objectRenderer",type:"Object"},{name:"geomIrradiance",type:"TextureIrradiance"},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"geomNormViewDepth",type:"TextureNormalizedViewDepth"},{name:"geomScreenDepth",type:"TextureScreenDepth"},{name:"geomViewNormal",type:"TextureViewNormal"},{name:"geomWorldNormal",type:"TextureWorldNormal"},{name:"geomLocalPosition",type:"TextureLocalPosition"},{name:"geomWorldPosition",type:"TextureWorldPosition"},{name:"geomAlbedo",type:"TextureAlbedo"},{name:"geomReflectivity",type:"TextureReflectivity"},{name:"geomVelocity",type:"TextureVelocity"},{name:"geomLinearVelocity",type:"TextureLinearVelocity"},{name:"geomObjectId",type:"TextureObjectId"}],properties:{doNotChangeAspectRatio:"boolean \u2013 do not change aspect ratio (default: true) \u2014 additionalConstructionParameters[0]",enableClusteredLights:"boolean \u2013 enable clustered lights (default: true) \u2014 additionalConstructionParameters[1]",depthTest:"boolean",depthWrite:"boolean",width:"number \u2013 G-buffer width in pixels (or percentage when sizeInPercentage=true)",height:"number \u2013 G-buffer height",sizeInPercentage:"boolean \u2013 use width/height as screen percentage (default: true)",samples:"number \u2013 MSAA sample count (default: 1)"},defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphUtilityLayerRendererBlock:{className:"NodeRenderGraphUtilityLayerRendererBlock",category:"Rendering",description:"Renders the Babylon.js utility layer (gizmos, helpers) on top of the main colour attachment. Used when the inspector / gizmos should appear in the final output.",inputs:[{name:"target",type:"AutoDetect"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphShadowGeneratorBlock:{className:"NodeRenderGraphShadowGeneratorBlock",category:"Rendering",description:"Generates a shadow map for a directional, spot, or point light. Connect its `generator` output (ShadowGenerator) to the `shadowGenerators` port of an ObjectRendererBlock so rendered objects receive shadows from this light.",inputs:[{name:"light",type:"ShadowLight"},{name:"objects",type:"ObjectList"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"generator",type:"ShadowGenerator"},{name:"output",type:"Texture"}],properties:{mapSize:"number \u2013 shadow map resolution (default: 1024)",useExponentialShadowMap:"boolean",usePoissonSampling:"boolean",useBlurExponentialShadowMap:"boolean",useCloseExponentialShadowMap:"boolean",useBlurCloseExponentialShadowMap:"boolean",usePCSShadowMap:"boolean",useVSM:"boolean",bias:"number",normalBias:"number"}},NodeRenderGraphCascadedShadowGeneratorBlock:{className:"NodeRenderGraphCascadedShadowGeneratorBlock",category:"Rendering",description:"Generates a Cascaded Shadow Map (CSM) for a directional light. CSM provides better quality close-up shadows with a smooth fade to lower quality at distance. Connect its `generator` output (ShadowGenerator) to the `shadowGenerators` port of an ObjectRendererBlock.",inputs:[{name:"light",type:"ShadowLight"},{name:"objects",type:"ObjectList"},{name:"camera",type:"Camera"},{name:"geomDepth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"generator",type:"ShadowGenerator"},{name:"output",type:"Texture"}],properties:{mapSize:"number \u2013 shadow map resolution per cascade (default: 1024)",numCascades:"number \u2013 number of cascades (default: 4; must be 2\u20134)",lambda:"number \u2013 0 = uniform, 1 = logarithmic split (default: 0.5)",shadowMaxZ:"number \u2013 maximum shadow distance"}},NodeRenderGraphCullObjectsBlock:{className:"NodeRenderGraphCullObjectsBlock",category:"Culling",description:"Culls an ObjectList using a camera frustum and returns a reduced ObjectList containing only the visible objects. Use this before passing objects to an ObjectRendererBlock for better performance.",inputs:[{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ObjectList"}]},NodeRenderGraphBloomPostProcessBlock:{className:"NodeRenderGraphBloomPostProcessBlock",category:"PostProcess",description:"Adds a bloom glow effect to bright areas of the source texture. Connect a rendered colour texture to `source`. Use additionalConstructionParameters=[hdr, bloomScale] to set HDR mode and scale at creation; threshold, weight, and kernel can be set via set_block_properties.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{hdr:"boolean \u2013 use HDR textures (default: false) \u2014 set via additionalConstructionParameters[0]",bloomScale:"number \u2013 scale factor (default: 0.5) \u2014 set via additionalConstructionParameters[1]",threshold:"number \u2013 brightness threshold to bloom (default: 0.9)",weight:"number \u2013 bloom intensity (default: 0.15)",kernel:"number \u2013 blur kernel size (default: 64)"},defaultAdditionalConstructionParameters:[!1,.5]},NodeRenderGraphBlurPostProcessBlock:{className:"NodeRenderGraphBlurPostProcessBlock",category:"PostProcess",description:"Applies a Gaussian blur to a texture. additionalConstructionParameters=[direction {x,y}, blockSize] control the blur direction and radius.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernel:"number \u2013 blur kernel size / radius"},defaultAdditionalConstructionParameters:[{x:1,y:0},1]},NodeRenderGraphFXAAPostProcessBlock:{className:"NodeRenderGraphFXAAPostProcessBlock",category:"PostProcess",description:"Applies Fast Approximate Anti-Aliasing (FXAA) to reduce jagged edges on the texture.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphSharpenPostProcessBlock:{className:"NodeRenderGraphSharpenPostProcessBlock",category:"PostProcess",description:"Sharpens the image to enhance detail clarity.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{colorAmount:"number \u2013 amount of colour sharpening (0\u20131, default: 0.8)",edgeAmount:"number \u2013 edge detection strength (0\u20132, default: 0.3)"}},NodeRenderGraphChromaticAberrationPostProcessBlock:{className:"NodeRenderGraphChromaticAberrationPostProcessBlock",category:"PostProcess",description:"Simulates lens chromatic aberration by separating the colour channels slightly.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{aberrationAmount:"number \u2013 strength of aberration (default: 30)",radialIntensity:"number \u2013 how the effect grows from centre outwards (default: 1)",direction:"{x,y} \u2013 direction of channel shift (default: {x:0.707,y:0.707})",centerPosition:"{x,y} \u2013 centre of effect (default: {x:0.5,y:0.5})"}},NodeRenderGraphGrainPostProcessBlock:{className:"NodeRenderGraphGrainPostProcessBlock",category:"PostProcess",description:"Overlays animated film-grain noise on the image.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{intensity:"number \u2013 grain intensity (default: 30)",animated:"boolean \u2013 animate noise each frame (default: true)"}},NodeRenderGraphBlackAndWhitePostProcessBlock:{className:"NodeRenderGraphBlackAndWhitePostProcessBlock",category:"PostProcess",description:"Converts the image to greyscale.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{degree:"number \u2013 0 = no change, 1 = fully greyscale (default: 1)"}},NodeRenderGraphTonemapPostProcessBlock:{className:"NodeRenderGraphTonemapPostProcessBlock",category:"PostProcess",description:"Applies tone-mapping to convert HDR values to LDR for display.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{operator:"number \u2013 tone-mapping operator: Hable=0, Reinhard=1, HejiDawson=2, Photographic=3, DX11DSK=4, Linear=5, ACES=6 (default: Hable=0)",exposureAdjustment:"number \u2013 exposure multiplier (default: 1)"}},NodeRenderGraphDepthOfFieldPostProcessBlock:{className:"NodeRenderGraphDepthOfFieldPostProcessBlock",category:"PostProcess",description:"Simulates camera depth-of-field blur. Requires a `geomViewDepth` texture (from a GeometryRenderer) and a Camera. additionalConstructionParameters=[blurLevel, hdr]: blurLevel values: Low=0, Medium=1, High=2.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{blurLevel:"number \u2013 blur quality (0=Low, 1=Medium, 2=High) \u2014 set via additionalConstructionParameters[0]",hdr:"boolean \u2013 use HDR \u2014 set via additionalConstructionParameters[1]",focalLength:"number \u2013 focal length in mm (default: 150)",fStop:"number \u2013 f-stop / aperture (default: 1.4)",focusDistance:"number \u2013 focus distance in mm (default: 2000)",lensSize:"number \u2013 lens size (default: 50)"},defaultAdditionalConstructionParameters:[0,!1]},NodeRenderGraphSSRPostProcessBlock:{className:"NodeRenderGraphSSRPostProcessBlock",category:"PostProcess",description:"Screen-Space Reflections (SSR). Requires geometry buffers from GeometryRendererBlock: geomDepth (ScreenDepth or ViewDepth), geomNormal (WorldNormal or ViewNormal), geomReflectivity, and a Camera. Optional geomBackDepth provides better occlusion accuracy.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"geomDepth",type:"AutoDetect"},{name:"geomNormal",type:"AutoDetect"},{name:"geomReflectivity",type:"TextureReflectivity"},{name:"geomBackDepth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{maxDistance:"number \u2013 max reflection ray distance (default: 1000)",step:"number \u2013 ray marching step size (default: 1)",thickness:"number \u2013 thickness tolerance (default: 0.5)",strength:"number \u2013 reflection strength (default: 1)",maxSteps:"number \u2013 maximum ray march iterations (default: 1000)",roughnessFactor:"number",selfCollisionNumSkip:"number \u2013 steps to skip for self-collision avoidance (default: 1)"}},NodeRenderGraphSSAO2PostProcessBlock:{className:"NodeRenderGraphSSAO2PostProcessBlock",category:"PostProcess",description:"Screen-Space Ambient Occlusion v2 (SSAO2). Requires a Camera plus `geomDepth` (TextureViewDepth) and `geomNormal` (TextureViewNormal) from a GeometryRendererBlock. additionalConstructionParameters=[ratio (number)].",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"geomDepth",type:"TextureViewDepth"},{name:"geomNormal",type:"TextureViewNormal"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ratio:"number \u2013 render ratio (default: 0.5) \u2014 set via additionalConstructionParameters[0]",maxZ:"number \u2013 max distance for AO sampling (default: 100)",minZAspect:"number",radius:"number \u2013 sampling radius (default: 2)",totalStrength:"number \u2013 AO intensity (default: 1)",base:"number \u2013 ambient baseline (default: 0)",samples:"number \u2013 sample count (default: 8)"},defaultAdditionalConstructionParameters:[.5]},NodeRenderGraphTAAPostProcessBlock:{className:"NodeRenderGraphTAAPostProcessBlock",category:"PostProcess",description:"Temporal Anti-Aliasing (TAA). Accumulates samples across frames for smooth anti-aliasing. Connect the `objectRenderer` output of an ObjectRendererBlock; optionally provide a `geomVelocity` (TextureLinearVelocity) texture. additionalConstructionParameters=[samples (number), factor (number)].",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"geomVelocity",type:"TextureLinearVelocity",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{samples:"number \u2013 number of accumulated samples (default: 8) \u2014 additionalConstructionParameters[0]",factor:"number \u2013 blend factor between current & accumulated (default: 0.05) \u2014 additionalConstructionParameters[1]"},defaultAdditionalConstructionParameters:[8,.05]},NodeRenderGraphMotionBlurPostProcessBlock:{className:"NodeRenderGraphMotionBlurPostProcessBlock",category:"PostProcess",description:"Applies motion blur based on per-pixel motion vectors. Optionally provide a `geomVelocity` (TextureVelocity) or `geomViewDepth` (TextureViewDepth) texture from a GeometryRendererBlock.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomVelocity",type:"TextureVelocity",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{motionBlurSamples:"number \u2013 number of samples (default: 32)",motionStrength:"number \u2013 overall blur strength (default: 1)"}},NodeRenderGraphImageProcessingPostProcessBlock:{className:"NodeRenderGraphImageProcessingPostProcessBlock",category:"PostProcess",description:"Applies the scene's ImageProcessingConfiguration (tone-mapping, exposure, contrast, saturation, colour grading LUT, etc.). This is the standard post-process used by the default rendering pipeline.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphColorCorrectionPostProcessBlock:{className:"NodeRenderGraphColorCorrectionPostProcessBlock",category:"PostProcess",description:"Applies colour correction using a colour-lookup table (LUT) texture.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{colorTableUrl:"string \u2013 URL/path to the colour lookup table texture"}},NodeRenderGraphConvolutionPostProcessBlock:{className:"NodeRenderGraphConvolutionPostProcessBlock",category:"PostProcess",description:"Applies a convolution kernel (e.g. edge detection, emboss, sharpen) to the image.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernel:"number[] \u2013 flat 3\xD73 convolution kernel values (9 numbers)"}},NodeRenderGraphFilterPostProcessBlock:{className:"NodeRenderGraphFilterPostProcessBlock",category:"PostProcess",description:"Applies a colour matrix filter to transform colours. Each row of the 4\xD74 matrix maps an output RGBA channel from input RGBA.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernelMatrix:"Matrix (16 numbers) \u2013 4\xD74 colour transformation matrix"}},NodeRenderGraphAnaglyphPostProcessBlock:{className:"NodeRenderGraphAnaglyphPostProcessBlock",category:"PostProcess",description:"Produces an anaglyph 3D effect (red-cyan glasses). Requires two texture views (left/right eye).",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"leftTexture",type:"AutoDetect"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphScreenSpaceCurvaturePostProcessBlock:{className:"NodeRenderGraphScreenSpaceCurvaturePostProcessBlock",category:"PostProcess",description:"Highlights surface curvature based on screen-space derivatives of normals.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewNormal",type:"TextureViewNormal"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ridge:"number \u2013 ridge curvature strength (default: 1)",valley:"number \u2013 valley curvature strength (default: 1)"}},NodeRenderGraphExtractHighlightsPostProcessBlock:{className:"NodeRenderGraphExtractHighlightsPostProcessBlock",category:"PostProcess",description:"Extracts pixels above a luminance threshold. Used as an intermediate step in bloom pipelines.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{threshold:"number \u2013 luminance threshold (default: 0.9)"}},NodeRenderGraphPassPostProcessBlock:{className:"NodeRenderGraphPassPostProcessBlock",category:"PostProcess",description:"A no-op pass-through post process. Useful for routing texture connections without modification.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphPassCubePostProcessBlock:{className:"NodeRenderGraphPassCubePostProcessBlock",category:"PostProcess",description:"A no-op pass-through post process for cube textures. Similar to PassPostProcessBlock but for cube map sources.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphCircleOfConfusionPostProcessBlock:{className:"NodeRenderGraphCircleOfConfusionPostProcessBlock",category:"PostProcess",description:"Computes per-pixel circle-of-confusion values from depth. Used as an input to more manual depth-of-field setups. Requires `geomViewDepth` and a Camera.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphVolumetricLightingBlock:{className:"NodeRenderGraphVolumetricLightingBlock",category:"PostProcess",description:"Renders volumetric light shafts (god rays) emanating from a single light source.",inputs:[{name:"target",type:"AutoDetect"},{name:"depth",type:"AutoDetect"},{name:"camera",type:"Camera"},{name:"lightingVolumeMesh",type:"ObjectList"},{name:"light",type:"ShadowLight"},{name:"lightingVolumeTexture",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{density:"number \u2013 ray density (default: 0.7)",weight:"number \u2013 light weight per step (default: 1)",decay:"number \u2013 falloff per step (default: 0.99)",exposure:"number \u2013 final exposure (default: 1)"}},NodeRenderGraphGlowLayerBlock:{className:"NodeRenderGraphGlowLayerBlock",category:"Layers",description:"Adds a glow effect to meshes whose emissive colour is above zero. Connect the `objectRenderer` output of an ObjectRendererBlock to this block's `objectRenderer` input. additionalConstructionParameters=[ldrMerge, layerTextureRatio, layerTextureFixedSize|undefined, layerTextureType].",inputs:[{name:"target",type:"AutoDetect"},{name:"layer",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ldrMerge:"boolean \u2013 clamp values > 1 in merge step (default: false) \u2014 additionalConstructionParameters[0]",layerTextureRatio:"number \u2013 glow texture size relative to main (default: 0.5) \u2014 additionalConstructionParameters[1]",layerTextureFixedSize:"number|undefined \u2013 fixed pixel size override \u2014 additionalConstructionParameters[2]",blurKernelSize:"number \u2013 blur spread (default: 32)",intensity:"number \u2013 glow intensity (default: 1)"},defaultAdditionalConstructionParameters:[!1,.5,void 0,0]},NodeRenderGraphHighlightLayerBlock:{className:"NodeRenderGraphHighlightLayerBlock",category:"Layers",description:"Draws a coloured outline / highlight on specific meshes. Connect the `objectRenderer` output of an ObjectRendererBlock to this block's `objectRenderer` input.",inputs:[{name:"target",type:"AutoDetect"},{name:"layer",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{blurHorizontalSize:"number \u2013 horizontal blur (default: 1)",blurVerticalSize:"number \u2013 vertical blur (default: 1)",isStroke:"boolean \u2013 render as stroke/outline instead of fill (default: false)"}},NodeRenderGraphSelectionOutlineLayerBlock:{className:"NodeRenderGraphSelectionOutlineLayerBlock",category:"Layers",description:"Draws a selection outline around the highlighted mesh. Typically used by the Babylon.js Inspector / gizmo system.",inputs:[{name:"target",type:"AutoDetect"},{name:"layer",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphComputeShaderBlock:{className:"NodeRenderGraphComputeShaderBlock",category:"Compute",description:"Executes a custom compute shader within the frame graph. Accepts camera, shadow light, and object list dependencies. Outputs a ResourceContainer for downstream ordering.",inputs:[{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ResourceContainer"}],properties:{shaderPath:"string | IComputeShaderPath \u2013 path or inline WGSL source of the compute shader",shaderOptions:"IComputeShaderOptions \u2013 binding mappings and compile options"},defaultAdditionalConstructionParameters:[`@compute @workgroup_size(1, 1, 1)
|
|
82
|
+
`)}_isDocumentRoute(t){return t==="document"||this._legacyDocumentRoutes.has(t)}_createSessionInfo(t){const r=this._sseClients.get(t.id)?.size??0,i={sessionId:t.id,kind:t.kind,name:t.name,revision:t.revision,createdAt:t.createdAt,updatedAt:t.updatedAt,conflictPolicy:Yo,subscriberCount:r,eventsUrl:`/session/${t.id}/events`,documentUrl:`/session/${t.id}/document`};for(const n of this._legacyDocumentRoutes)i[`${n}Url`]=`/session/${t.id}/${n}`;return i}_getSessionInfoList(){return[...this._sessions.values()].map(t=>this._createSessionInfo(t))}_getSseClientCount(){let t=0;for(const r of this._sseClients.values())t+=r.size;return t}async _readBodyAsync(t){const r=[];return await new Promise((i,n)=>{t.on("data",o=>r.push(o)),t.on("end",i),t.on("error",n)}),Buffer.concat(r).toString("utf-8")}_writeJson(t,r,i){t.statusCode=r,t.setHeader("Content-Type","application/json; charset=utf-8"),t.end(JSON.stringify(i))}_writeText(t,r,i){t.statusCode=r,t.setHeader("Content-Type","text/plain; charset=utf-8"),t.end(i)}}class Gx{constructor(t,r={}){this._manager=null,this._sessionServer=null,this._adapter=t,this._options=r}isRunning(){return this._sessionServer?.isRunning()??!1}async startAsync(t,r){return this._manager=t,await this._getSessionServer().startAsync(r)}async stopAsync(){this._sessionServer&&await this._sessionServer.stopAsync()}createSession(t){return this._getSessionServer().createSession(t).id}getSessionIdForName(t){return this._sessionServer?.getSessionIdForName(t)}getSessionUrl(t,r){return this._getSessionServer().getSessionUrl(t,r)}notifySessionUpdate(t){this._sessionServer?.notifySessionUpdate(t)}closeSession(t){return this._sessionServer?.closeSession(t)??!1}closeSessionForName(t){return this._sessionServer?.closeSessionForName(t)??!1}getPort(){return this._sessionServer?.getPort()??0}getHealth(){return this._getSessionServer().getHealth()}getDiagnostics(){return this._getSessionServer().getDiagnostics()}_getSessionServer(){return this._sessionServer||(this._sessionServer=new Vx({serverName:this._adapter.serverName,documentKind:this._adapter.documentKind,getDocument:t=>this._manager?this._adapter.getDocument(this._manager,t):void 0,setDocument:(t,r)=>this._manager?this._adapter.setDocument(this._manager,t,r):this._adapter.managerUnavailableMessage??"Document manager is not available"},this._options)),this._sessionServer}}const Kn={NodeRenderGraphInputBlock:{className:"NodeRenderGraphInputBlock",category:"Input",description:"Exposes an external resource to the render graph. The type is determined by `additionalConstructionParameters[0]` (a NodeRenderGraphBlockConnectionPointTypes enum value). Common type values: Texture=1, TextureDepthStencilAttachment=8, Camera=0x01000000, ObjectList=0x02000000, ShadowLight=0x00400000. Set `isExternal=true` so Babylon auto-fills the value from the scene at build time. For texture inputs you must provide `creationOptions` with size/format/samples; use the `set_block_properties` tool to set these fields after adding the block.",inputs:[],outputs:[{name:"output",type:"AutoDetect"}],properties:{isExternal:"boolean \u2013 when true Babylon.js fills the value automatically (cameras, object-lists, lights). Default: false",creationOptions:"FrameGraphTextureCreationOptions JSON \u2013 for texture inputs; defines size, format, samples, etc."},defaultAdditionalConstructionParameters:[1073741824]},NodeRenderGraphOutputBlock:{className:"NodeRenderGraphOutputBlock",category:"Output",description:"The final output block. Every render graph MUST have exactly one. Connect the last rendered texture to the `texture` port. The outputNodeId of the serialised graph must equal this block's id.",inputs:[{name:"texture",type:"Texture",isOptional:!1},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[]},NodeRenderGraphClearBlock:{className:"NodeRenderGraphClearBlock",category:"Textures",description:"Clears a colour texture and/or depth-stencil attachment to a configurable colour / depth value. Both `target` and `depth` are optional, but at least one should be connected. Outputs mirror the connected inputs so downstream blocks can use the cleared textures.",inputs:[{name:"target",type:"AutoDetect",isOptional:!0},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"}],properties:{color:"Color4 {r,g,b,a} \u2013 clear colour (default: {r:0,g:0,b:0,a:1})",clearColor:"boolean \u2013 whether to clear the colour channel (default: true)",clearDepth:"boolean \u2013 whether to clear the depth channel (default: false)",clearStencil:"boolean \u2013 whether to clear the stencil channel (default: false)",convertColorToLinearSpace:"boolean \u2013 convert sRGB clear colour to linear space (default: false)"}},NodeRenderGraphCopyTextureBlock:{className:"NodeRenderGraphCopyTextureBlock",category:"Textures",description:"Copies (blits) one texture into another. Useful for preserving intermediate render results or preparing textures for later read-back.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphGenerateMipmapsBlock:{className:"NodeRenderGraphGenerateMipmapsBlock",category:"Textures",description:"Generates all mip-map levels for a texture in-place after prior rendering has been done. Required for techniques that sample lower mip levels (e.g. bloom, reflections).",inputs:[{name:"target",type:"AutoDetect"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphObjectRendererBlock:{className:"NodeRenderGraphObjectRendererBlock",category:"Rendering",description:"Renders a list of scene objects (meshes, particles) to a colour target using a camera. This is the primary rasterisation block \u2014 almost every graph needs one. Connect a cleared colour texture to `target`, a depth attachment to `depth`, a Camera input to `camera`, and a (possibly culled) ObjectList to `objects`. Optional `shadowGenerators` port accepts a ShadowGenerator or ResourceContainer of shadow generators.",inputs:[{name:"target",type:"AutoDetect"},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0},{name:"shadowGenerators",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"},{name:"objectRenderer",type:"Object"}],properties:{doNotChangeAspectRatio:"boolean \u2013 do not change the aspect ratio of the scene when rendering to RTT (default: true). Set as additionalConstructionParameters[0]",enableClusteredLights:"boolean \u2013 enable clustered light rendering (default: true). Set as additionalConstructionParameters[1]",isMainObjectRenderer:"boolean \u2013 marks this as the main object renderer; only one block should be main per graph. Babylon.js auto-assigns the first one if none is set.",depthTest:"boolean \u2013 enable depth testing (default: true)",depthWrite:"boolean \u2013 enable depth writing (default: true)",disableShadows:"boolean \u2013 disable shadow sampling (default: false)",renderParticles:"boolean \u2013 render particle systems (default: true)",renderSprites:"boolean \u2013 render sprite managers (default: true)"},defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphGeometryRendererBlock:{className:"NodeRenderGraphGeometryRendererBlock",category:"Rendering",description:"Renders scene geometry into a multi-render target (G-Buffer), producing typed geometry textures (view-depth, normals, albedo, reflectivity, positions, velocity, etc.). Use these outputs as inputs for deferred shading techniques such as SSR, SSAO, or custom deferred passes. The `target` port for the colour attachment is OPTIONAL for this block.",inputs:[{name:"target",type:"AutoDetect",isOptional:!0},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0},{name:"shadowGenerators",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"},{name:"outputDepth",type:"BasedOnInput"},{name:"objectRenderer",type:"Object"},{name:"geomIrradiance",type:"TextureIrradiance"},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"geomNormViewDepth",type:"TextureNormalizedViewDepth"},{name:"geomScreenDepth",type:"TextureScreenDepth"},{name:"geomViewNormal",type:"TextureViewNormal"},{name:"geomWorldNormal",type:"TextureWorldNormal"},{name:"geomLocalPosition",type:"TextureLocalPosition"},{name:"geomWorldPosition",type:"TextureWorldPosition"},{name:"geomAlbedo",type:"TextureAlbedo"},{name:"geomReflectivity",type:"TextureReflectivity"},{name:"geomVelocity",type:"TextureVelocity"},{name:"geomLinearVelocity",type:"TextureLinearVelocity"},{name:"geomObjectId",type:"TextureObjectId"},{name:"geomMeshBlendTag",type:"TextureMeshBlendTag"}],properties:{doNotChangeAspectRatio:"boolean \u2013 do not change aspect ratio (default: true) \u2014 additionalConstructionParameters[0]",enableClusteredLights:"boolean \u2013 enable clustered lights (default: true) \u2014 additionalConstructionParameters[1]",depthTest:"boolean",depthWrite:"boolean",width:"number \u2013 G-buffer width in pixels (or percentage when sizeInPercentage=true)",height:"number \u2013 G-buffer height",sizeInPercentage:"boolean \u2013 use width/height as screen percentage (default: true)",samples:"number \u2013 MSAA sample count (default: 1)"},defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphUtilityLayerRendererBlock:{className:"NodeRenderGraphUtilityLayerRendererBlock",category:"Rendering",description:"Renders the Babylon.js utility layer (gizmos, helpers) on top of the main colour attachment. Used when the inspector / gizmos should appear in the final output.",inputs:[{name:"target",type:"AutoDetect"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],defaultAdditionalConstructionParameters:[!0,!0]},NodeRenderGraphShadowGeneratorBlock:{className:"NodeRenderGraphShadowGeneratorBlock",category:"Rendering",description:"Generates a shadow map for a directional, spot, or point light. Connect its `generator` output (ShadowGenerator) to the `shadowGenerators` port of an ObjectRendererBlock so rendered objects receive shadows from this light.",inputs:[{name:"light",type:"ShadowLight"},{name:"objects",type:"ObjectList"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"generator",type:"ShadowGenerator"},{name:"output",type:"Texture"}],properties:{mapSize:"number \u2013 shadow map resolution (default: 1024)",useExponentialShadowMap:"boolean",usePoissonSampling:"boolean",useBlurExponentialShadowMap:"boolean",useCloseExponentialShadowMap:"boolean",useBlurCloseExponentialShadowMap:"boolean",usePCSShadowMap:"boolean",useVSM:"boolean",bias:"number",normalBias:"number"}},NodeRenderGraphCascadedShadowGeneratorBlock:{className:"NodeRenderGraphCascadedShadowGeneratorBlock",category:"Rendering",description:"Generates a Cascaded Shadow Map (CSM) for a directional light. CSM provides better quality close-up shadows with a smooth fade to lower quality at distance. Connect its `generator` output (ShadowGenerator) to the `shadowGenerators` port of an ObjectRendererBlock.",inputs:[{name:"light",type:"ShadowLight"},{name:"objects",type:"ObjectList"},{name:"camera",type:"Camera"},{name:"geomDepth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"generator",type:"ShadowGenerator"},{name:"output",type:"Texture"}],properties:{mapSize:"number \u2013 shadow map resolution per cascade (default: 1024)",numCascades:"number \u2013 number of cascades (default: 4; must be 2\u20134)",lambda:"number \u2013 0 = uniform, 1 = logarithmic split (default: 0.5)",shadowMaxZ:"number \u2013 maximum shadow distance"}},NodeRenderGraphCullObjectsBlock:{className:"NodeRenderGraphCullObjectsBlock",category:"Culling",description:"Culls an ObjectList using a camera frustum and returns a reduced ObjectList containing only the visible objects. Use this before passing objects to an ObjectRendererBlock for better performance.",inputs:[{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ObjectList"}]},NodeRenderGraphBloomPostProcessBlock:{className:"NodeRenderGraphBloomPostProcessBlock",category:"PostProcess",description:"Adds a bloom glow effect to bright areas of the source texture. Connect a rendered colour texture to `source`. Use additionalConstructionParameters=[hdr, bloomScale] to set HDR mode and scale at creation; threshold, weight, and kernel can be set via set_block_properties.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{hdr:"boolean \u2013 use HDR textures (default: false) \u2014 set via additionalConstructionParameters[0]",bloomScale:"number \u2013 scale factor (default: 0.5) \u2014 set via additionalConstructionParameters[1]",threshold:"number \u2013 brightness threshold to bloom (default: 0.9)",weight:"number \u2013 bloom intensity (default: 0.15)",kernel:"number \u2013 blur kernel size (default: 64)"},defaultAdditionalConstructionParameters:[!1,.5]},NodeRenderGraphBlurPostProcessBlock:{className:"NodeRenderGraphBlurPostProcessBlock",category:"PostProcess",description:"Applies a Gaussian blur to a texture. additionalConstructionParameters=[direction {x,y}, blockSize] control the blur direction and radius.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernel:"number \u2013 blur kernel size / radius"},defaultAdditionalConstructionParameters:[{x:1,y:0},1]},NodeRenderGraphFXAAPostProcessBlock:{className:"NodeRenderGraphFXAAPostProcessBlock",category:"PostProcess",description:"Applies Fast Approximate Anti-Aliasing (FXAA) to reduce jagged edges on the texture.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphSharpenPostProcessBlock:{className:"NodeRenderGraphSharpenPostProcessBlock",category:"PostProcess",description:"Sharpens the image to enhance detail clarity.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{colorAmount:"number \u2013 amount of colour sharpening (0\u20131, default: 0.8)",edgeAmount:"number \u2013 edge detection strength (0\u20132, default: 0.3)"}},NodeRenderGraphChromaticAberrationPostProcessBlock:{className:"NodeRenderGraphChromaticAberrationPostProcessBlock",category:"PostProcess",description:"Simulates lens chromatic aberration by separating the colour channels slightly.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{aberrationAmount:"number \u2013 strength of aberration (default: 30)",radialIntensity:"number \u2013 how the effect grows from centre outwards (default: 1)",direction:"{x,y} \u2013 direction of channel shift (default: {x:0.707,y:0.707})",centerPosition:"{x,y} \u2013 centre of effect (default: {x:0.5,y:0.5})"}},NodeRenderGraphGrainPostProcessBlock:{className:"NodeRenderGraphGrainPostProcessBlock",category:"PostProcess",description:"Overlays animated film-grain noise on the image.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{intensity:"number \u2013 grain intensity (default: 30)",animated:"boolean \u2013 animate noise each frame (default: true)"}},NodeRenderGraphBlackAndWhitePostProcessBlock:{className:"NodeRenderGraphBlackAndWhitePostProcessBlock",category:"PostProcess",description:"Converts the image to greyscale.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{degree:"number \u2013 0 = no change, 1 = fully greyscale (default: 1)"}},NodeRenderGraphTonemapPostProcessBlock:{className:"NodeRenderGraphTonemapPostProcessBlock",category:"PostProcess",description:"Applies tone-mapping to convert HDR values to LDR for display.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{operator:"number \u2013 tone-mapping operator: Hable=0, Reinhard=1, HejiDawson=2, Photographic=3, DX11DSK=4, Linear=5, ACES=6 (default: Hable=0)",exposureAdjustment:"number \u2013 exposure multiplier (default: 1)"}},NodeRenderGraphDepthOfFieldPostProcessBlock:{className:"NodeRenderGraphDepthOfFieldPostProcessBlock",category:"PostProcess",description:"Simulates camera depth-of-field blur. Requires a `geomViewDepth` texture (from a GeometryRenderer) and a Camera. additionalConstructionParameters=[blurLevel, hdr]: blurLevel values: Low=0, Medium=1, High=2.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{blurLevel:"number \u2013 blur quality (0=Low, 1=Medium, 2=High) \u2014 set via additionalConstructionParameters[0]",hdr:"boolean \u2013 use HDR \u2014 set via additionalConstructionParameters[1]",focalLength:"number \u2013 focal length in mm (default: 150)",fStop:"number \u2013 f-stop / aperture (default: 1.4)",focusDistance:"number \u2013 focus distance in mm (default: 2000)",lensSize:"number \u2013 lens size (default: 50)"},defaultAdditionalConstructionParameters:[0,!1]},NodeRenderGraphSSRPostProcessBlock:{className:"NodeRenderGraphSSRPostProcessBlock",category:"PostProcess",description:"Screen-Space Reflections (SSR). Requires geometry buffers from GeometryRendererBlock: geomDepth (ScreenDepth or ViewDepth), geomNormal (WorldNormal or ViewNormal), geomReflectivity, and a Camera. Optional geomBackDepth provides better occlusion accuracy.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"geomDepth",type:"AutoDetect"},{name:"geomNormal",type:"AutoDetect"},{name:"geomReflectivity",type:"TextureReflectivity"},{name:"geomBackDepth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{maxDistance:"number \u2013 max reflection ray distance (default: 1000)",step:"number \u2013 ray marching step size (default: 1)",thickness:"number \u2013 thickness tolerance (default: 0.5)",strength:"number \u2013 reflection strength (default: 1)",maxSteps:"number \u2013 maximum ray march iterations (default: 1000)",roughnessFactor:"number",selfCollisionNumSkip:"number \u2013 steps to skip for self-collision avoidance (default: 1)"}},NodeRenderGraphSSAO2PostProcessBlock:{className:"NodeRenderGraphSSAO2PostProcessBlock",category:"PostProcess",description:"Screen-Space Ambient Occlusion v2 (SSAO2). Requires a Camera plus `geomDepth` (TextureViewDepth) and `geomNormal` (TextureViewNormal) from a GeometryRendererBlock. additionalConstructionParameters=[ratio (number)].",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"geomDepth",type:"TextureViewDepth"},{name:"geomNormal",type:"TextureViewNormal"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ratio:"number \u2013 render ratio (default: 0.5) \u2014 set via additionalConstructionParameters[0]",maxZ:"number \u2013 max distance for AO sampling (default: 100)",minZAspect:"number",radius:"number \u2013 sampling radius (default: 2)",totalStrength:"number \u2013 AO intensity (default: 1)",base:"number \u2013 ambient baseline (default: 0)",samples:"number \u2013 sample count (default: 8)"},defaultAdditionalConstructionParameters:[.5]},NodeRenderGraphTAAPostProcessBlock:{className:"NodeRenderGraphTAAPostProcessBlock",category:"PostProcess",description:"Temporal Anti-Aliasing (TAA). Accumulates samples across frames for smooth anti-aliasing. Connect the `objectRenderer` output of an ObjectRendererBlock; optionally provide a `geomVelocity` (TextureLinearVelocity) texture. additionalConstructionParameters=[samples (number), factor (number)].",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"geomVelocity",type:"TextureLinearVelocity",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{samples:"number \u2013 number of accumulated samples (default: 8) \u2014 additionalConstructionParameters[0]",factor:"number \u2013 blend factor between current & accumulated (default: 0.05) \u2014 additionalConstructionParameters[1]"},defaultAdditionalConstructionParameters:[8,.05]},NodeRenderGraphMotionBlurPostProcessBlock:{className:"NodeRenderGraphMotionBlurPostProcessBlock",category:"PostProcess",description:"Applies motion blur based on per-pixel motion vectors. Optionally provide a `geomVelocity` (TextureVelocity) or `geomViewDepth` (TextureViewDepth) texture from a GeometryRendererBlock.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomVelocity",type:"TextureVelocity",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{motionBlurSamples:"number \u2013 number of samples (default: 32)",motionStrength:"number \u2013 overall blur strength (default: 1)"}},NodeRenderGraphImageProcessingPostProcessBlock:{className:"NodeRenderGraphImageProcessingPostProcessBlock",category:"PostProcess",description:"Applies the scene's ImageProcessingConfiguration (tone-mapping, exposure, contrast, saturation, colour grading LUT, etc.). This is the standard post-process used by the default rendering pipeline.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphColorCorrectionPostProcessBlock:{className:"NodeRenderGraphColorCorrectionPostProcessBlock",category:"PostProcess",description:"Applies colour correction using a colour-lookup table (LUT) texture.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{colorTableUrl:"string \u2013 URL/path to the colour lookup table texture"}},NodeRenderGraphConvolutionPostProcessBlock:{className:"NodeRenderGraphConvolutionPostProcessBlock",category:"PostProcess",description:"Applies a convolution kernel (e.g. edge detection, emboss, sharpen) to the image.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernel:"number[] \u2013 flat 3\xD73 convolution kernel values (9 numbers)"}},NodeRenderGraphFilterPostProcessBlock:{className:"NodeRenderGraphFilterPostProcessBlock",category:"PostProcess",description:"Applies a colour matrix filter to transform colours. Each row of the 4\xD74 matrix maps an output RGBA channel from input RGBA.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{kernelMatrix:"Matrix (16 numbers) \u2013 4\xD74 colour transformation matrix"}},NodeRenderGraphAnaglyphPostProcessBlock:{className:"NodeRenderGraphAnaglyphPostProcessBlock",category:"PostProcess",description:"Produces an anaglyph 3D effect (red-cyan glasses). Requires two texture views (left/right eye).",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"leftTexture",type:"AutoDetect"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphScreenSpaceCurvaturePostProcessBlock:{className:"NodeRenderGraphScreenSpaceCurvaturePostProcessBlock",category:"PostProcess",description:"Highlights surface curvature based on screen-space derivatives of normals.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewNormal",type:"TextureViewNormal"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ridge:"number \u2013 ridge curvature strength (default: 1)",valley:"number \u2013 valley curvature strength (default: 1)"}},NodeRenderGraphMeshBlendingPostProcessBlock:{className:"NodeRenderGraphMeshBlendingPostProcessBlock",category:"PostProcess",description:"Blends source colors across seams between different nonzero mesh groups using packed R8UI mesh tags and depth. Optional linear geometry albedo enables shadow estimation. Low quality interpolates in sRGB; Medium and above use OKLab.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"camera",type:"Camera"},{name:"geomDepth",type:"AutoDetect"},{name:"geomAlbedo",type:"TextureAlbedo",isOptional:!0},{name:"geomMeshBlendTag",type:"TextureMeshBlendTag"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{quality:"number \u2013 compile-time quality variant (0=Low, 1=Medium, 2=High, 3=Cinematic; default: 1). High and Cinematic enable close-neighbor fallback, tiny-object protection, and secondary-target blending.",smallWorldRadius:"number \u2013 small-class authored world radius (default: 0.06)",smallMinimumProjectedRadius:"number \u2013 small-class minimum physical-pixel radius (default: 1.5)",mediumWorldRadius:"number \u2013 medium-class authored world radius (default: 0.1)",mediumMinimumProjectedRadius:"number \u2013 medium-class minimum physical-pixel radius (default: 3)",largeWorldRadius:"number \u2013 large-class authored world radius (default: 0.2)",largeMinimumProjectedRadius:"number \u2013 large-class minimum physical-pixel radius (default: 3)",extraLargeWorldRadius:"number \u2013 extra-large-class authored world radius (default: 0.3)",extraLargeMinimumProjectedRadius:"number \u2013 extra-large-class minimum physical-pixel radius (default: 5)",slopeFactor:"number \u2013 contact-slope narrowing factor; 1 disables narrowing (default: 2)",debugMode:"number \u2013 debug visualization (0=Off, 1=PackedTag, 2=CandidateDirectionDistance, 3=SeamFade, 4=RejectionReason, 5=StageWork, 6=Continuation, 7=TinyObject, 8=MultiTarget, 9=TargetColor, 10=ShadowAttenuation, 11=ColorInterpolation, 12=WorldPosition; default: 0)"}},NodeRenderGraphExtractHighlightsPostProcessBlock:{className:"NodeRenderGraphExtractHighlightsPostProcessBlock",category:"PostProcess",description:"Extracts pixels above a luminance threshold. Used as an intermediate step in bloom pipelines.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{threshold:"number \u2013 luminance threshold (default: 0.9)"}},NodeRenderGraphPassPostProcessBlock:{className:"NodeRenderGraphPassPostProcessBlock",category:"PostProcess",description:"A no-op pass-through post process. Useful for routing texture connections without modification.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphPassCubePostProcessBlock:{className:"NodeRenderGraphPassCubePostProcessBlock",category:"PostProcess",description:"A no-op pass-through post process for cube textures. Similar to PassPostProcessBlock but for cube map sources.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphCircleOfConfusionPostProcessBlock:{className:"NodeRenderGraphCircleOfConfusionPostProcessBlock",category:"PostProcess",description:"Computes per-pixel circle-of-confusion values from depth. Used as an input to more manual depth-of-field setups. Requires `geomViewDepth` and a Camera.",inputs:[{name:"source",type:"AutoDetect"},{name:"target",type:"AutoDetect",isOptional:!0},{name:"geomViewDepth",type:"TextureViewDepth"},{name:"camera",type:"Camera"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphVolumetricLightingBlock:{className:"NodeRenderGraphVolumetricLightingBlock",category:"PostProcess",description:"Renders volumetric light shafts (god rays) emanating from a single light source.",inputs:[{name:"target",type:"AutoDetect"},{name:"depth",type:"AutoDetect"},{name:"camera",type:"Camera"},{name:"lightingVolumeMesh",type:"ObjectList"},{name:"light",type:"ShadowLight"},{name:"lightingVolumeTexture",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{density:"number \u2013 ray density (default: 0.7)",weight:"number \u2013 light weight per step (default: 1)",decay:"number \u2013 falloff per step (default: 0.99)",exposure:"number \u2013 final exposure (default: 1)"}},NodeRenderGraphGlowLayerBlock:{className:"NodeRenderGraphGlowLayerBlock",category:"Layers",description:"Adds a glow effect to meshes whose emissive colour is above zero. Connect the `objectRenderer` output of an ObjectRendererBlock to this block's `objectRenderer` input. additionalConstructionParameters=[ldrMerge, layerTextureRatio, layerTextureFixedSize|undefined, layerTextureType].",inputs:[{name:"target",type:"AutoDetect"},{name:"layer",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{ldrMerge:"boolean \u2013 clamp values > 1 in merge step (default: false) \u2014 additionalConstructionParameters[0]",layerTextureRatio:"number \u2013 glow texture size relative to main (default: 0.5) \u2014 additionalConstructionParameters[1]",layerTextureFixedSize:"number|undefined \u2013 fixed pixel size override \u2014 additionalConstructionParameters[2]",blurKernelSize:"number \u2013 blur spread (default: 32)",intensity:"number \u2013 glow intensity (default: 1)"},defaultAdditionalConstructionParameters:[!1,.5,void 0,0]},NodeRenderGraphHighlightLayerBlock:{className:"NodeRenderGraphHighlightLayerBlock",category:"Layers",description:"Draws a coloured outline / highlight on specific meshes. Connect the `objectRenderer` output of an ObjectRendererBlock to this block's `objectRenderer` input.",inputs:[{name:"target",type:"AutoDetect"},{name:"layer",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}],properties:{blurHorizontalSize:"number \u2013 horizontal blur (default: 1)",blurVerticalSize:"number \u2013 vertical blur (default: 1)",isStroke:"boolean \u2013 render as stroke/outline instead of fill (default: false)"}},NodeRenderGraphSelectionOutlineLayerBlock:{className:"NodeRenderGraphSelectionOutlineLayerBlock",category:"Layers",description:"Draws a selection outline around the highlighted mesh. Typically used by the Babylon.js Inspector / gizmo system.",inputs:[{name:"target",type:"AutoDetect"},{name:"layer",type:"AutoDetect",isOptional:!0},{name:"objectRenderer",type:"Object"},{name:"depth",type:"AutoDetect",isOptional:!0},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphComputeShaderBlock:{className:"NodeRenderGraphComputeShaderBlock",category:"Compute",description:"Executes a custom compute shader within the frame graph. Accepts camera, shadow light, and object list dependencies. Outputs a ResourceContainer for downstream ordering.",inputs:[{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ResourceContainer"}],properties:{shaderPath:"string | IComputeShaderPath \u2013 path or inline WGSL source of the compute shader",shaderOptions:"IComputeShaderOptions \u2013 binding mappings and compile options"},defaultAdditionalConstructionParameters:[`@compute @workgroup_size(1, 1, 1)
|
|
83
83
|
fn main() {}`,{bindingsMapping:{}}]},NodeRenderGraphIblShadowsRendererBlock:{className:"NodeRenderGraphIblShadowsRendererBlock",category:"Rendering",description:"Computes image-based lighting (IBL) shadows using voxel tracing. Requires depth, normal, position, and velocity geometry textures plus a camera and object list. Produces a shadow texture output.",inputs:[{name:"depth",type:"TextureScreenDepth"},{name:"normal",type:"TextureWorldNormal"},{name:"position",type:"TextureWorldPosition"},{name:"velocity",type:"TextureLinearVelocity"},{name:"camera",type:"Camera"},{name:"objects",type:"ObjectList"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"Texture"}],properties:{sampleDirections:"number \u2013 tracing sample directions (1\u201316, default: varies)",coloredShadows:"boolean \u2013 whether traced shadows preserve environment color",voxelShadowOpacity:"number \u2013 opacity of voxel-traced shadows (0\u20131)",ssShadowOpacity:"number \u2013 opacity of screen-space shadows (0\u20131)",ssShadowSampleCount:"number \u2013 screen-space shadow samples (1\u201364)",ssShadowStride:"number \u2013 screen-space shadow stride (1\u201332)",ssShadowDistanceScale:"number \u2013 screen-space shadow distance scale",ssShadowThicknessScale:"number \u2013 screen-space shadow thickness scale",voxelNormalBias:"number \u2013 voxel tracing normal bias",voxelDirectionBias:"number \u2013 voxel tracing direction bias",envRotation:"number \u2013 environment rotation in radians",shadowRemanence:"number \u2013 temporal shadow remanence (0\u20131)",shadowOpacity:"number \u2013 final shadow opacity (0\u20131)",resolutionExp:"number \u2013 voxelization resolution exponent (1\u20138, resolution = 2^value)",refreshRate:"number \u2013 voxelization refresh rate (-1: manual, 0: every frame, N: skip N frames)",triPlanarVoxelization:"boolean \u2013 whether to use tri-planar voxelization"}},NodeRenderGraphResourceContainerBlock:{className:"NodeRenderGraphResourceContainerBlock",category:"Utility",description:"Groups multiple texture handles (or shadow generators) into one `ResourceContainer` output. Use its output as the `dependencies` input of other blocks to express execution ordering without a direct data-flow connection.",inputs:[{name:"resource0",type:"AutoDetect",isOptional:!0},{name:"resource1",type:"AutoDetect",isOptional:!0},{name:"resource2",type:"AutoDetect",isOptional:!0},{name:"resource3",type:"AutoDetect",isOptional:!0},{name:"resource4",type:"AutoDetect",isOptional:!0},{name:"resource5",type:"AutoDetect",isOptional:!0},{name:"resource6",type:"AutoDetect",isOptional:!0},{name:"resource7",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ResourceContainer"}]},NodeRenderGraphElbowBlock:{className:"NodeRenderGraphElbowBlock",category:"Utility",description:"A routing (elbow / pass-through) block that lets you organise connections visually. The output type mirrors whatever is connected to the input.",inputs:[{name:"input",type:"AutoDetect"}],outputs:[{name:"output",type:"BasedOnInput"}]},NodeRenderGraphTeleportInBlock:{className:"NodeRenderGraphTeleportInBlock",category:"Utility",description:"Teleport entry-point. Connects to one or more TeleportOutBlocks to route a signal across the graph without drawing long connection wires. Must be paired with at least one TeleportOutBlock of the same name.",inputs:[{name:"input",type:"AutoDetect"}],outputs:[]},NodeRenderGraphTeleportOutBlock:{className:"NodeRenderGraphTeleportOutBlock",category:"Utility",description:"Teleport exit-point. Receives the value wired into its matching TeleportInBlock. Multiple TeleportOut blocks can share the same TeleportIn, distributing one signal to many consumers.",inputs:[],outputs:[{name:"output",type:"AutoDetect"}]},NodeRenderGraphExecuteBlock:{className:"NodeRenderGraphExecuteBlock",category:"Utility",description:"Runs a custom JavaScript callback within the frame-graph execution order. This block is for advanced use \u2014 the callback must be set at runtime in code.",inputs:[{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"AutoDetect"}]},NodeRenderGraphLightingVolumeBlock:{className:"NodeRenderGraphLightingVolumeBlock",category:"Utility",description:"Computes a lighting volume used by the volumetric lighting block for light contribution slicing.",inputs:[{name:"shadowGenerator",type:"ShadowGenerator"},{name:"dependencies",type:"AutoDetect",isOptional:!0}],outputs:[{name:"output",type:"ObjectList"}]}};function O$(){const e={};for(const[r,i]of Object.entries(Kn)){const n=i.category;e[n]=e[n]||[],e[n].push(`- **${r}**: ${i.description.split(".")[0]}`)}const t=[];for(const[r,i]of Object.entries(e))t.push(`
|
|
84
84
|
### ${r}`),t.push(...i);return t.join(`
|
|
85
85
|
`)}function qx(e){const t=Kn[e];if(!t)return`Unknown block type "${e}". Use list_block_types to see available types.`;const r=[`## ${e}`,`**Category**: ${t.category}`,`**Description**: ${t.description}`,"","### Inputs"];if(t.inputs.length===0)r.push("_(none)_");else for(const i of t.inputs)r.push(`- \`${i.name}\` \u2014 **${i.type}**${i.isOptional?" _(optional)_":""}`);if(r.push("","### Outputs"),t.outputs.length===0)r.push("_(none)_");else for(const i of t.outputs)r.push(`- \`${i.name}\` \u2014 **${i.type}**`);if(t.properties&&Object.keys(t.properties).length>0){r.push("","### Configurable Properties");for(const[i,n]of Object.entries(t.properties))r.push(`- \`${i}\`: ${n}`)}return t.defaultAdditionalConstructionParameters!==void 0&&r.push("","### additionalConstructionParameters",`Default: \`${JSON.stringify(t.defaultAdditionalConstructionParameters)}\``,"These are embedded in the serialised block. Override them when calling add_block if needed."),r.join(`
|
|
@@ -101,7 +101,7 @@ ${a.map(s=>`exports.${s} = ${s};`).join(`
|
|
|
101
101
|
`}return t}function D$(e,t,r){const i=Object.keys(e).filter(l=>/\.m?jsx?$/i.test(l)),n={},o={};for(const l of i)n[l]=uD(e[l]);const a=l=>{if(o[l])return o[l].exports;if(!/\.m?jsx?$/i.test(l))return o[l]={exports:e[l]},e[l];const d={exports:{}};o[l]=d;const m=p=>{if(p.startsWith(".")||p.startsWith("/")){const g=z$(l,p),v=x$(g,e);if(v)return a(v);throw new Error(`Unable to resolve script-mode module "${p}" from "${l}"`)}if(p.startsWith("@babylonjs/"))return globalThis.BABYLON??{};if(r&&p in r)throw new Error(`Script mode cannot execute external import "${p}" (${r[p]}). Use moduleFormat: "esm" or pre-bundle dependencies.`);return globalThis[p]};return new Function("require","exports","module",n[l])(m,d.exports,d),d.exports},s=a(t);for(const l of i)l in o||a(l);const c={...s??{}},u=["createScene","CreateScene","createscene","delayCreateScene","delayLoadScene","DelayCreateScene","createEngine","Playground"];for(const l of u)c[l]===void 0&&typeof globalThis[l]<"u"&&(c[l]=globalThis[l]);return c}function lD(e){let t="";/\bexport\s+default\s+class\s+Playground\b/.test(e)?t="default.CreateScene":/\bexport\s+(const|let|var|function)\s+delayCreateScene\b/.test(e)?t="delayCreateScene":/\bexport\s+(const|let|var|function)\s+delayLoadScene\b/.test(e)?t="delayLoadScene":/\bexport\s+(const|let|var|function)\s+createScene\b/.test(e)?t="createScene":/\bexport\s+(const|let|var|function)\s+CreateScene\b/.test(e)?t="CreateScene":/\bexport\s+(const|let|var|function)\s+createscene\b/.test(e)?t="createscene":/\bexport\s+default\b/.test(e)&&(t="default");const r=/\bexport\s+(const|let|var|function)\s+createEngine\b/.test(e)||/\bexport\s*\{[^}]*\bcreateEngine\b[^}]*\}\s*;?/.test(e);return{sceneFunctionName:t,createEngineFn:r?i=>{}:null,createEngineSource:r?"snippet":"default"}}function E$(e){let t=null,r="";const i=[[()=>e.default?.CreateScene,"default.CreateScene"],[()=>e.default?.DelayCreateScene,"default.DelayCreateScene"],[()=>e.Playground?.CreateScene,"Playground.CreateScene"],[()=>e.Playground?.DelayCreateScene,"Playground.DelayCreateScene"],[()=>typeof e.delayCreateScene=="function"?e.delayCreateScene:null,"delayCreateScene"],[()=>typeof e.delayLoadScene=="function"?e.delayLoadScene:null,"delayLoadScene"],[()=>typeof e.createScene=="function"?e.createScene:null,"createScene"],[()=>typeof e.CreateScene=="function"?e.CreateScene:null,"CreateScene"],[()=>typeof e.createscene=="function"?e.createscene:null,"createscene"],[()=>typeof e.default=="function"?e.default:null,"default"]];for(const[o,a]of i){const s=o();if(s){t=s,r=a;break}}let n=null;return typeof e.createEngine=="function"&&(n=e.createEngine),{createSceneFn:t,sceneFunctionName:r,createEngineFn:n}}function dD(e){return async(t,r)=>{const i=r?.antialias??!0,n=r?.engineOptions??{preserveDrawingBuffer:!0,stencil:!0},o=globalThis.BABYLON;if(!o)throw new Error("BABYLON is not available on globalThis. Ensure Babylon.js is loaded before calling createEngine.");if(e==="WebGPU"&&o.WebGPUEngine){const a=new o.WebGPUEngine(t,{antialias:i,enableAllFeatures:!0,setMaximumLimits:!0,...n});return await a.initAsync(),a}return new o.Engine(t,i,n)}}function fD(e){const t=Object.values(e).join(`
|
|
102
102
|
`);return{havok:/\bHavokPlugin\b/.test(t),ammo:/\bAmmoJSPlugin\b/.test(t),recast:/\bRecastJSPlugin\b/.test(t)}}const jl=(()=>{const e=new Set;return async t=>await new Promise((r,i)=>{if(e.has(t))return r();const n=document.createElement("script");n.src=t,n.async=!0,n.onload=()=>{e.add(t),r()},n.onerror=()=>i(new Error(`Failed to load script: ${t}`)),document.head.appendChild(n)})})();async function mD(e,t){const r=globalThis,i=t?.loadScripts===!0,n=t?.scriptUrls??{},o=(t?.baseUrl??Hx).replace(/\/+$/,""),a=s=>n[s]??`${o}/${Kx[s]}`;if(e.ammo){if(typeof r.Ammo!="function"&&i)try{await jl(a("ammo"))}catch{}if(typeof r.Ammo=="function")try{await r.Ammo()}catch{}}if(e.recast){if(typeof r.Recast!="function"&&i)try{await jl(a("recast"))}catch{}if(typeof r.Recast=="function")try{await r.Recast()}catch{}}if(e.havok){if(typeof r.HavokPhysics!="function"&&i)try{await jl(a("havok"))}catch{}if(typeof r.HavokPhysics=="function"&&typeof r.HK>"u")try{r.HK=await r.HavokPhysics()}catch{}}}function pD(e,t,r,i,n,o){let a=null,s;const c=e[t]??"",u=lD(c),l=async()=>(s||(r==="esm"?a=await cD(e,t,n):a=D$(e,t,n),s=E$(a),d=s.createEngineFn?"snippet":"default",m=s.sceneFunctionName),s);let d=u.createEngineSource,m=u.sceneFunctionName;const f=async(g,v)=>{const{createEngineFn:$}=await l();return $?await $(g,v):await dD(i)(g,v)},p=async(g,v)=>{const{createSceneFn:$}=await l();if(!$)throw new Error("No createScene export found in snippet (tried: default.CreateScene, Playground.CreateScene, createScene, delayCreateScene, default).");const y=globalThis,_=y.engine,I=y.canvas,T=y.BABYLON,A=T?.Tools?.BaseUrl,B=T?.Tools?.PreprocessUrl;r==="script"&&(y.engine=g,y.canvas=v);const ue=void 0;try{let fe;const M=await $.bind(new Proxy({},{get(Q,Y){return Y==="scene"?fe:Y==="engine"?g:Y==="canvas"?v:globalThis[Y]},set(Q,Y,W){return Y==="scene"?(fe=W,!0):(globalThis[Y]=W,!0)}}))(g,v);return M!=null&&(fe=M),ue?.(),fe}finally{r==="script"&&(y.engine=_,y.canvas=I),T?.Tools&&(T.Tools.BaseUrl=A,T.Tools.PreprocessUrl=B)}};return r==="script"&&(a=D$(e,t,n),s=E$(a),m=s.sceneFunctionName,d=s.createEngineFn?"snippet":"default"),{createEngine:f,createScene:p,getCreateEngineSource:()=>d,getSceneFunctionName:()=>m,initializeMetadataAsync:async()=>{r==="script"&&await l()}}}async function hD(e,t){const r=await Wx(e,Dl);return await gD(r,e,t)}async function gD(e,t,r){const i={name:e.name??"",description:e.description??"",tags:e.tags??""},n=e.jsonPayload??e.payload??"{}";let o;try{o=JSON.parse(n)}catch{return{snippetId:t,type:"unknown",metadata:i,rawPayload:n}}const a=Qx(o),s=r?.moduleFormat??"esm";switch(a){case"playground":{const c=sD(o,t,i),u=c.manifest?.entry?.replace(/\.tsx?$/i,".js")??"index.js",l=Object.keys(c.files).some(g=>/\.tsx?$/i.test(g));let d;if(l){const g=(async(v,$)=>await rD(v,$));d=await iD(c.files,g)}else d={...c.files};const m=pD(d,u,s,c.engineType,c.manifest?.imports);await m.initializeMetadataAsync();const f=fD(c.files);return{...c,jsFiles:d,executedCode:d[u]??"",moduleFormat:s,createEngine:m.createEngine,createScene:m.createScene,createEngineSource:m.getCreateEngineSource(),sceneFunctionName:m.getSceneFunctionName(),runtimeFeatures:f,initializeRuntimeAsync:async g=>await mD(f,g)}}case"unknown":return{snippetId:t,type:"unknown",metadata:i,rawPayload:o};default:return eD(o,a,t,i)}}function vD(e,t){return JSON.stringify({payload:e,name:t?.metadata?.name??"",description:t?.metadata?.description??"",tags:t?.metadata?.tags??""})}function yD(e){const t=e.type,r=typeof e.data=="string"?e.data:JSON.stringify(e.data);return JSON.stringify({[t]:r})}function $D(e){const t=e.indexOf("#");return t>=0?e.slice(0,t):e}async function _D(e,t){let r;r=yD(e);const i=vD(r,t),n=(t?.snippetUrl??Dl).replace(/\/+$/,""),o=t?.snippetId?$D(t.snippetId):"",a=o?`${n}/${o}`:n,s=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:i});if(!s.ok)throw new Error(`Failed to save snippet: ${s.status} ${s.statusText}`);const c=await s.json(),u=c.id,l=String(c.version??"0");let d=u;return l&&l!=="0"&&(d+="#"+l),{snippetId:d,id:u,version:l}}const De=new Jx,We=new Gx({serverName:"NRGE MCP Session Server",documentKind:"node-render-graph",managerUnavailableMessage:"Render graph manager is not available",getDocument:(e,t)=>e.exportJson(t.name),setDocument:(e,t,r)=>{try{e.importJson(t.name,r,!0);return}catch(i){return i.message}}},{defaultPort:3001,statusTitle:"NRGE MCP Session Server"});function en(e){const t=We.getSessionIdForName(e);t&&We.notifySessionUpdate(t)}function j$(e,t,r=!1){const i=De.importJson(e,t,r);return en(e),i}const ye=new mx({name:"babylonjs-node-render-graph",version:"1.0.0"},{instructions:["You build Babylon.js Node Render Graphs (custom render pipelines). Workflow: create_render_graph \u2192 add blocks (NodeRenderGraphInputBlock, object/geometry renderers, post-process blocks, NodeRenderGraphOutputBlock) \u2192 connect ports \u2192 validate_graph \u2192 export_graph_json.","Every render graph needs an InputBlock (provides camera/scene) and an OutputBlock (final framebuffer). Use get_block_type_info to discover ports.","Output JSON can be consumed by the Scene MCP via attach_node_render_graph."].join(" ")});ye.registerResource("block-catalog","nrg://block-catalog",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:`# NRG Block Catalog
|
|
103
103
|
|
|
104
|
-
${O$()}`}]})),ye.registerResource("enums","nrg://enums",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:["# NRG Enumerations Reference","","## NodeRenderGraphBlockConnectionPointTypes","These numeric values are used as `additionalConstructionParameters[0]` for **NodeRenderGraphInputBlock**.","","| Type name | Value (hex) | Value (decimal) | Description |","|-----------|------------|-----------------|-------------|","| Texture | 0x00000001 | 1 | Generic colour texture (RGBA) |","| TextureBackBuffer | 0x00000002 | 2 | The engine's back-buffer render target |","| TextureBackBufferDepthStencilAttachment | 0x00000004 | 4 | Depth/stencil attachment of the back buffer |","| TextureDepthStencilAttachment | 0x00000008 | 8 | Depth/stencil attachment for off-screen textures |","| TextureViewDepth | 0x00000010 | 16 | View-space depth (geometry renderer output) |","| TextureViewNormal | 0x00000020 | 32 | View-space normal (geometry renderer output) |","| TextureAlbedo | 0x00000040 | 64 | Albedo/diffuse G-buffer texture |","| TextureReflectivity | 0x00000080 | 128 | Reflectivity G-buffer texture |","| TextureWorldPosition | 0x00000100 | 256 | World-space position G-buffer texture |","| TextureVelocity | 0x00000200 | 512 | Screen-space velocity (motion vectors) |","| TextureIrradiance | 0x00000400 | 1024 | Irradiance G-buffer texture |","| TextureLinearVelocity | 0x00000800 | 2048 | Linear (camera-space) velocity |","| TextureLocalPosition | 0x00001000 | 4096 | Local/object-space position |","| TextureWorldNormal | 0x00002000 | 8192 | World-space normal |","| TextureAlbedoSqrt | 0x00004000 | 16384 | Sqrt-mapped albedo for IBL |","| TextureObjectId | 0x00020000 | 131072 | 24-bit RGBA object ID texture |","| ResourceContainer | 0x00100000 | 1048576 | Shared GPU resource container |","| ShadowGenerator | 0x00200000 | 2097152 | Shadow generator output |","| ShadowLight | 0x00400000 | 4194304 | Directional/spot/point light for shadow casting |","| Camera | 0x01000000 | 16777216 | Scene camera |","| ObjectList | 0x02000000 | 33554432 | List of renderable objects/meshes |","| Object | 0x80000000 | 2147483648 | Generic internal task object (e.g. ObjectRendererTask) |","| AutoDetect | 0x10000000 | 268435456 | Type is resolved automatically at build time |","| BasedOnInput | 0x20000000 | 536870912 | Output type mirrors a specific input |","","## Using InputBlock types","When adding a `NodeRenderGraphInputBlock` you must pass the connection-point type as","`additionalConstructionParameters[0]` (an integer from the table above).","","Common examples:"," \u2022 Back-buffer colour: `additionalConstructionParameters: [2]` (TextureBackBuffer)"," \u2022 Off-screen texture: `additionalConstructionParameters: [1]` (Texture)"," \u2022 Depth/stencil: `additionalConstructionParameters: [8]` (TextureDepthStencilAttachment)"," \u2022 Back-buffer depth: `additionalConstructionParameters: [4]` (TextureBackBufferDepthStencilAttachment)"," \u2022 Camera: `additionalConstructionParameters: [16777216]` (Camera)"," \u2022 Object list: `additionalConstructionParameters: [33554432]` (ObjectList)"," \u2022 Shadow light: `additionalConstructionParameters: [4194304]` (ShadowLight)","","## Key additionalConstructionParameters for other blocks","","**NodeRenderGraphObjectRendererBlock**","`[doNotChangeAspectRatio (boolean), enableClusteredLights (boolean)]`","Default: `[true, false]`","","**NodeRenderGraphGeometryRendererBlock** (same as ObjectRenderer)","Default: `[true, false]`","","**NodeRenderGraphBloomPostProcessBlock**","`[hdr (boolean), bloomScale (number)]` \u2014 hdr enables HDR pipeline; bloomScale controls texture scale.","Default: `[false, 0.5]`","","**NodeRenderGraphDepthOfFieldPostProcessBlock**","`[blurLevel (0|1|2 = Low|Medium|High), hdr (boolean)]`","Default: `[0, false]`","","**NodeRenderGraphSSRPostProcessBlock**","`[textureType (number)]` \u2014 Engine.TEXTURETYPE_UNSIGNED_BYTE=0, TEXTURETYPE_HALF_FLOAT=2.","Default: `[0]`","","**NodeRenderGraphTAAPostProcessBlock**","`[samples (number), factor (number)]` \u2014 Defaults: 8 samples, factor 1.0.","Default: `[8, 1.0]`","","**NodeRenderGraphGlowLayerBlock**","`[ldrMerge (boolean), ratio (number), fixedSize (number|undefined), type (number|undefined)]`","Default: `[false, 0.5, undefined, undefined]`"].join(`
|
|
104
|
+
${O$()}`}]})),ye.registerResource("enums","nrg://enums",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:["# NRG Enumerations Reference","","## NodeRenderGraphBlockConnectionPointTypes","These numeric values are used as `additionalConstructionParameters[0]` for **NodeRenderGraphInputBlock**.","","| Type name | Value (hex) | Value (decimal) | Description |","|-----------|------------|-----------------|-------------|","| Texture | 0x00000001 | 1 | Generic colour texture (RGBA) |","| TextureBackBuffer | 0x00000002 | 2 | The engine's back-buffer render target |","| TextureBackBufferDepthStencilAttachment | 0x00000004 | 4 | Depth/stencil attachment of the back buffer |","| TextureDepthStencilAttachment | 0x00000008 | 8 | Depth/stencil attachment for off-screen textures |","| TextureViewDepth | 0x00000010 | 16 | View-space depth (geometry renderer output) |","| TextureViewNormal | 0x00000020 | 32 | View-space normal (geometry renderer output) |","| TextureAlbedo | 0x00000040 | 64 | Albedo/diffuse G-buffer texture |","| TextureReflectivity | 0x00000080 | 128 | Reflectivity G-buffer texture |","| TextureWorldPosition | 0x00000100 | 256 | World-space position G-buffer texture |","| TextureVelocity | 0x00000200 | 512 | Screen-space velocity (motion vectors) |","| TextureIrradiance | 0x00000400 | 1024 | Irradiance G-buffer texture |","| TextureLinearVelocity | 0x00000800 | 2048 | Linear (camera-space) velocity |","| TextureLocalPosition | 0x00001000 | 4096 | Local/object-space position |","| TextureWorldNormal | 0x00002000 | 8192 | World-space normal |","| TextureAlbedoSqrt | 0x00004000 | 16384 | Sqrt-mapped albedo for IBL |","| TextureObjectId | 0x00020000 | 131072 | 24-bit RGBA object ID texture |","| TextureMeshBlendTag | 0x00040000 | 262144 | Packed R8UI mesh-blending tag texture |","| ResourceContainer | 0x00100000 | 1048576 | Shared GPU resource container |","| ShadowGenerator | 0x00200000 | 2097152 | Shadow generator output |","| ShadowLight | 0x00400000 | 4194304 | Directional/spot/point light for shadow casting |","| Camera | 0x01000000 | 16777216 | Scene camera |","| ObjectList | 0x02000000 | 33554432 | List of renderable objects/meshes |","| Object | 0x80000000 | 2147483648 | Generic internal task object (e.g. ObjectRendererTask) |","| AutoDetect | 0x10000000 | 268435456 | Type is resolved automatically at build time |","| BasedOnInput | 0x20000000 | 536870912 | Output type mirrors a specific input |","","## Using InputBlock types","When adding a `NodeRenderGraphInputBlock` you must pass the connection-point type as","`additionalConstructionParameters[0]` (an integer from the table above).","","Common examples:"," \u2022 Back-buffer colour: `additionalConstructionParameters: [2]` (TextureBackBuffer)"," \u2022 Off-screen texture: `additionalConstructionParameters: [1]` (Texture)"," \u2022 Depth/stencil: `additionalConstructionParameters: [8]` (TextureDepthStencilAttachment)"," \u2022 Back-buffer depth: `additionalConstructionParameters: [4]` (TextureBackBufferDepthStencilAttachment)"," \u2022 Camera: `additionalConstructionParameters: [16777216]` (Camera)"," \u2022 Object list: `additionalConstructionParameters: [33554432]` (ObjectList)"," \u2022 Shadow light: `additionalConstructionParameters: [4194304]` (ShadowLight)","","## Key additionalConstructionParameters for other blocks","","**NodeRenderGraphObjectRendererBlock**","`[doNotChangeAspectRatio (boolean), enableClusteredLights (boolean)]`","Default: `[true, false]`","","**NodeRenderGraphGeometryRendererBlock** (same as ObjectRenderer)","Default: `[true, false]`","","**NodeRenderGraphBloomPostProcessBlock**","`[hdr (boolean), bloomScale (number)]` \u2014 hdr enables HDR pipeline; bloomScale controls texture scale.","Default: `[false, 0.5]`","","**NodeRenderGraphDepthOfFieldPostProcessBlock**","`[blurLevel (0|1|2 = Low|Medium|High), hdr (boolean)]`","Default: `[0, false]`","","**NodeRenderGraphSSRPostProcessBlock**","`[textureType (number)]` \u2014 Engine.TEXTURETYPE_UNSIGNED_BYTE=0, TEXTURETYPE_HALF_FLOAT=2.","Default: `[0]`","","**NodeRenderGraphTAAPostProcessBlock**","`[samples (number), factor (number)]` \u2014 Defaults: 8 samples, factor 1.0.","Default: `[8, 1.0]`","","**NodeRenderGraphGlowLayerBlock**","`[ldrMerge (boolean), ratio (number), fixedSize (number|undefined), type (number|undefined)]`","Default: `[false, 0.5, undefined, undefined]`"].join(`
|
|
105
105
|
`)}]})),ye.registerResource("concepts","nrg://concepts",{},async e=>({contents:[{uri:e.href,mimeType:"text/markdown",text:["# Node Render Graph (NRG) Concepts","","## What is a Node Render Graph?","The Node Render Graph is Babylon.js's frame-graph-based render pipeline builder.","Instead of writing custom render loops, you connect typed blocks that represent render","operations \u2014 clearing textures, rendering objects, applying post-processes, adding layers \u2014","and Babylon.js executes them in the correct order at runtime.","","## Graph Execution Model","NRG graphs are **directed acyclic graphs** of render tasks. Data flows","**left-to-right**: source blocks produce textures/objects/cameras that downstream","blocks consume. The graph evaluates every frame.","","## Required Output Block","Every render graph MUST contain exactly **one** `NodeRenderGraphOutputBlock`.","Its `texture` input must be connected with the final rendered colour texture.","The block's `id` is stored as `outputNodeId` in the serialised JSON.","","## Block Categories","","### Input (sources of external data)"," \u2022 **NodeRenderGraphInputBlock** \u2014 exposes an external resource (texture, camera,"," object list, shadow light) as a graph input. Set `additionalConstructionParameters[0]`"," to the desired connection-point type (see nrg://enums)."," \u2022 **NodeRenderGraphOutputBlock** \u2014 the required graph sink. Connect the final"," colour texture to its `texture` input.","","### Textures (GPU texture operations)"," \u2022 **NodeRenderGraphClearBlock** \u2014 clears a texture with a solid colour /"," optional depth clear. Usually the first block that processes a texture."," \u2022 **NodeRenderGraphCopyTextureBlock** \u2014 copies one texture to another."," \u2022 **NodeRenderGraphGenerateMipmapsBlock** \u2014 generates mipmaps for sampled textures.","","### Rendering (draw calls)"," \u2022 **NodeRenderGraphObjectRendererBlock** \u2014 the standard forward-rendering block."," Needs: objectList, camera, texture (colour RT), textureDepth (depth/stencil RT)."," \u2022 **NodeRenderGraphGeometryRendererBlock** \u2014 deferred G-buffer renderer. Writes"," multiple G-buffer textures (viewDepth, viewNormal, albedo, reflectivity, ...)."," \u2022 **NodeRenderGraphShadowGeneratorBlock** \u2014 renders a shadow map for one light."," \u2022 **NodeRenderGraphCascadedShadowGeneratorBlock** \u2014 cascaded shadow-map generator."," \u2022 **NodeRenderGraphCullObjectsBlock** \u2014 culls objects to a frustum. Outputs"," separate lists for opaque / alpha-test / transparent objects.","","### Post-Process (screen-space effects applied to a texture)","All post-process blocks accept `source` (the input texture) and output `output`","(the processed texture). They also require a `camera` input.","Notable blocks: Bloom, Blur, FXAA, Sharpen, ChromaticAberration, Grain,","BlackAndWhite, Tonemap, DepthOfField, SSR, SSAO2, TAA, MotionBlur,","ImageProcessing, ColorCorrection, Convolution, Filter, Pass, and more.","","### Layers (translucent overlay passes)"," \u2022 **NodeRenderGraphGlowLayerBlock** \u2014 adds a halo-glow effect."," \u2022 **NodeRenderGraphHighlightLayerBlock** \u2014 adds coloured outlines/glow to"," specific meshes."," \u2022 **NodeRenderGraphSelectionOutlineLayerBlock** \u2014 renders an outline around"," selected objects.","","### Utility (graph helpers)"," \u2022 **NodeRenderGraphResourceContainerBlock** \u2014 groups GPU resources for sharing."," \u2022 **NodeRenderGraphElbowBlock** \u2014 re-routes a connection wire (cosmetic)."," \u2022 **NodeRenderGraphTeleportInBlock / TeleportOutBlock** \u2014 split long-distance"," wires into a named teleport pair."," \u2022 **NodeRenderGraphExecuteBlock** \u2014 runs an arbitrary custom callback inside"," the frame graph.","","## The Simplest Render Graph","```","InputBlock(BackBuffer) \u2192 ClearBlock.target \u2192 ObjectRendererBlock.texture","InputBlock(BackBufferDepth) \u2192 ObjectRendererBlock.textureDepth","InputBlock(Camera) \u2192 ObjectRendererBlock.camera","InputBlock(ObjectList) \u2192 ObjectRendererBlock.objects","ObjectRendererBlock.texture \u2192 OutputBlock.texture","```","","## Adding a Post-Process","Post-process blocks sit BETWEEN the renderer output and the OutputBlock:","```","...ObjectRendererBlock.texture \u2192 BloomBlock.source","InputBlock(Camera) \u2192 BloomBlock.camera","BloomBlock.output \u2192 OutputBlock.texture","```","","## Scene MCP Integration","After exporting NRG JSON with `export_graph_json`, pass it to the","Scene MCP server's `attach_node_render_graph` tool to apply it to a scene.","The scene MCP will store the JSON and emit the appropriate","`NodeRenderGraph.ParseAsync(...)` code in the generated scene script.","","## Common Mistakes","1. Forgetting NodeRenderGraphOutputBlock \u2014 graph cannot evaluate.","2. Not setting `additionalConstructionParameters` on InputBlock.","3. Not connecting a camera to post-process blocks.","4. Leaving ObjectRendererBlock.objects or .camera disconnected.","5. Using wrong texture types \u2014 colour targets need Texture (1) or"," TextureBackBuffer (2); depth targets need the depth-stencil types (4 or 8)."].join(`
|
|
106
106
|
`)}]})),ye.registerPrompt("basic-render-graph",{description:"Step-by-step instructions for building the simplest possible render graph (clear + object renderer + output) for use with the Scene MCP."},()=>({messages:[{role:"user",content:{type:"text",text:["Build a minimal render graph that renders a scene's objects to the back-buffer.","","Steps:","1. create_render_graph name='BasicPipeline'","2. add_block blockType='NodeRenderGraphInputBlock' blockName='BackBuffer'"," additionalConstructionParameters=[2] \u2190 TextureBackBuffer","3. add_block blockType='NodeRenderGraphInputBlock' blockName='DepthBuffer'"," additionalConstructionParameters=[4] \u2190 TextureBackBufferDepthStencilAttachment","4. add_block blockType='NodeRenderGraphInputBlock' blockName='MainCamera'"," additionalConstructionParameters=[16777216] \u2190 Camera","5. add_block blockType='NodeRenderGraphInputBlock' blockName='Objects'"," additionalConstructionParameters=[33554432] \u2190 ObjectList","6. add_block blockType='NodeRenderGraphClearBlock' blockName='Clear'","7. add_block blockType='NodeRenderGraphObjectRendererBlock' blockName='Renderer'","8. add_block blockType='NodeRenderGraphOutputBlock' blockName='Output'","","Connections:","9. connect BackBuffer.output \u2192 Clear.target","10. connect Clear.output \u2192 Renderer.texture","11. connect DepthBuffer.output \u2192 Renderer.textureDepth","12. connect MainCamera.output \u2192 Renderer.camera","13. connect Objects.output \u2192 Renderer.objects","14. connect Renderer.texture \u2192 Output.texture","","15. validate_graph","16. export_graph_json","17. Optionally: pass the JSON to the Scene MCP `attach_node_render_graph` tool."].join(`
|
|
107
107
|
`)}}]})),ye.registerPrompt("post-process-pipeline",{description:"Step-by-step instructions for building a render graph with Bloom and FXAA post-processes."},()=>({messages:[{role:"user",content:{type:"text",text:["Build a render graph: clear \u2192 render objects \u2192 Bloom \u2192 FXAA \u2192 output.","","1. create_render_graph name='BloomFxaaPipeline'","2-5. Add InputBlocks for BackBuffer, DepthBuffer, MainCamera, Objects (same types as basic-render-graph).","6. add_block NodeRenderGraphClearBlock 'Clear'","7. add_block NodeRenderGraphObjectRendererBlock 'Renderer'","8. add_block NodeRenderGraphBloomPostProcessBlock 'Bloom'"," additionalConstructionParameters=[false, 0.5] \u2190 hdr=false, bloomScale=0.5","9. add_block NodeRenderGraphFXAAPostProcessBlock 'FXAA'","10. add_block NodeRenderGraphOutputBlock 'Output'","","Connections:","11. BackBuffer.output \u2192 Clear.target","12. Clear.output \u2192 Renderer.texture","13. DepthBuffer.output \u2192 Renderer.textureDepth","14. MainCamera.output \u2192 Renderer.camera","15. Objects.output \u2192 Renderer.objects","16. Renderer.texture \u2192 Bloom.source","17. MainCamera.output \u2192 Bloom.camera","18. Bloom.output \u2192 FXAA.source","19. MainCamera.output \u2192 FXAA.camera","20. FXAA.output \u2192 Output.texture","","21. validate_graph","22. export_graph_json"].join(`
|