# Typescript shaders

With Hology Engine, you can write your shaders directly in Typescript, the same programming languages as the rest of your game play code. You can express any logic that you can do in a lower level language as GLSL while enjoying the benefits of using a higher level language like Typescript.

Internally, typescript code will build up a graph of nodes representing the calculations, which explains the use of the word node. These nodes are then converted to the code that is compiled to run on the GPU so it has no negative effect on performance.

See [Creating shaders](/shaders/creating-shaders.md) for how to create a new Typescript shaders that can be used to create materials in the editor.

You can also use this shader library to create shaders for materials that are created directly in code instead of in the editor.

```typescript
import { rgb, standardMaterial, translateY, sin, float, NodeShaderMaterial, timeUniforms } from "@hology/core/shader-nodes"
import { SphereGeometry, Mesh } from "three"


const time = timeUniforms.elapsed
const diffuse = rgb(0x00ff00)
const color = standardMaterial({ color: diffuse })
const bounce = translateY(sin(time.multiply(float(5))))

const material = new NodeShaderMaterial({
  color,
  transform: bounce
})

const sphere = new SphereGeometry(5, 30, 15)
const mesh = new Mesh(sphere, material)
```


---

# Agent Instructions: 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://docs.hology.app/shaders/typescript-shaders.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.
