> For the complete documentation index, see [llms.txt](https://dynamics.solsarratea.world/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dynamics.solsarratea.world/content/day-1/opcustomshader.md).

# OpCustomShader

```
#ifdef GL_ES
precision highp float;
#endif

IN vec2 texCoord;

// Incoming texture: we tried video and webcam
uniform sampler2D uTexture0;

// Incoming number values
uniform float uTime;
uniform float uNoseX;
uniform float uNoseY;


{{MODULES_HEAD}}

void main()
{
  
   // 1. We read the incoming texture as a vector 4
   vec4 color = texture2D(uTexture0, texCoord); // [ r, g, b, a] 
   
   
   // 2. We use the coordinates given from the operator to place the particles 
   // in the world space
   vec4 positions = vec4(
       (texCoord.x + uNoseX)*20.-10.,           
       (texCoord.y +uNoseY)*20.-10.,          
       color.r*2.,               
       1.);
  
   
   //3. We write 2 textures
   outColor0 = positions; // Has information of the position of the particles
   outColor1= color;      // Will colorize the particles
   
   outColor2 = vec4(0.);
   outColor3 = vec4(0.);
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dynamics.solsarratea.world/content/day-1/opcustomshader.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
