Skip to content

Commit

Permalink
chore: added save_shader in flag in translator api
Browse files Browse the repository at this point in the history
  • Loading branch information
samthakur587 authored Aug 28, 2024
1 parent b891b83 commit 421e229
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,14 @@ shader main {
import crosstl

# Translate to Metal
metal_code = crosstl.translate('shader.cgl', backend='metal')
metal_code = crosstl.translate('shader.cgl', backend='metal', save_shader= 'shader.metal')

# Translate to DirectX (HLSL)
hlsl_code = crosstl.translate('shader.cgl', backend='directx')
hlsl_code = crosstl.translate('shader.cgl', backend='directx', save_shader= 'shader.hlsl')

# Translate to OpenGL
opengl_code = crosstl.translate('shader.cgl', backend='opengl')
opengl_code = crosstl.translate('shader.cgl', backend='opengl', save_shader= 'shader.glsl')

```

#### Converting from HLSL to CrossGL
Expand Down Expand Up @@ -214,7 +215,7 @@ float4 PSMain(PS_INPUT input) : SV_TARGET {
```python
import crosstl

crossgl_code = crosstl.translate('shader.hlsl', backend='cgl')
crossgl_code = crosstl.translate('shader.hlsl', backend='cgl', save_shader= 'shader.cgl')
print(crossgl_code)
```

Expand Down

0 comments on commit 421e229

Please sign in to comment.