# Create a custom shader

**URL:** <https://forum.deepar.ai/t/create-a-custom-shader/53>\
**Category:** Studio\
**Created:** [August 25, 2022, 12:15am UTC](https://forum.deepar.ai/t/create-a-custom-shader/53 "2022-08-25T00:15:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdelhamid\_3wais](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/abdelhamid_3wais/32/73_2.png) [@Abdelhamid\_3wais](https://forum.deepar.ai/u/Abdelhamid_3wais)\
**Post date:** [August 25, 2022, 12:15am UTC](https://forum.deepar.ai/t/create-a-custom-shader/53/1 "2022-08-25T00:15:49Z")

</div>

I’m working with different AR platform like spark AR and lens studio . And I can create my custom shader for each software . But for DeepAr studio it is more complicated and no tutorials available .  
Please I need to learn creating a custom shader for DeepAr studio . I have read a lot about bgfx but it should be explained practically on DeepAr studio. For example converting any open source shader from shaderToy or other to DeepAr studio

---

<div class="post-metadata">

**Author:** ![jelena](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/jelena/32/14_2.png) [@jelena](https://forum.deepar.ai/u/jelena)\
**Post date:** [August 25, 2022, 1:25pm UTC](https://forum.deepar.ai/t/create-a-custom-shader/53/2 "2022-08-25T13:25:18Z")

</div>

Hi @Abdelhamid_3wais  
We are working on simplifying the shader creation and will be making a tutorial soon. In the meantime, you can tell us more about what exactly you need and we can try to give you some specific help

---

<div class="post-metadata">

**Author:** ![Abdelhamid\_3wais](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/abdelhamid_3wais/32/73_2.png) [@Abdelhamid\_3wais](https://forum.deepar.ai/u/Abdelhamid_3wais)\
**Post date:** [August 25, 2022, 2:00pm UTC](https://forum.deepar.ai/t/create-a-custom-shader/53/3 "2022-08-25T14:00:10Z")

</div>

Thanks 😊 Jelena

I want to understand how to create a custom fragment shader to perform a specific function . For example shaderToy has a lot of open source stuff for learning but there are a lot of differences between it and DeepAr shaders depending on bgfx libraries . It is very complicated for me. I used to work in glsl with lens studio or spark AR studio. I need a video explaining write custom shaders for DeepAr studio. I think that the explanation video will be better than written documentation .

---

<div class="post-metadata">

**Author:** ![jelena](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/jelena/32/14_2.png) [@jelena](https://forum.deepar.ai/u/jelena)\
**Post date:** [August 25, 2022, 2:38pm UTC](https://forum.deepar.ai/t/create-a-custom-shader/53/4 "2022-08-25T14:38:06Z")

</div>

We are working on some improvements to the shader creation and we intend to create some tutorial videos when those improvements are released. Do you have a specific shader you would like to translate so we can try and help you?

---

<div class="post-metadata">

**Author:** ![Abdelhamid\_3wais](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/abdelhamid_3wais/32/73_2.png) [@Abdelhamid\_3wais](https://forum.deepar.ai/u/Abdelhamid_3wais)\
**Post date:** [August 25, 2022, 3:23pm UTC](https://forum.deepar.ai/t/create-a-custom-shader/53/5 "2022-08-25T15:23:03Z")

</div>

Yes please 😊  
Something like this will be a nice filter

> **[Shadertoy](https://www.shadertoy.com/view/ldjGzV)**
>
> Build shaders, share them, and learn from the best community.

This code contains many things such textures inputs and sampling it will good add some input parameters  
To the shader .  
Of course, with respect to the rights of the owner of the shader, but this is for the purpose of education and understanding and not for use in another way

---

<div class="post-metadata">

**Author:** ![jelena](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.deepar.ai/jelena/32/14_2.png) [@jelena](https://forum.deepar.ai/u/jelena)\
**Post date:** [August 29, 2022, 12:03pm UTC](https://forum.deepar.ai/t/create-a-custom-shader/53/6 "2022-08-29T12:03:03Z")

</div>

That shader shouldn’t be translated as is, but there also isn’t a 1:1 translation that only uses a shader.  
Some things that should be easy to translate are:  
iResolution - we use u\_cameraSize  
iTime - u\_currentTime

For texture sampling we use

vec4 color = texture2D(s\_tex v\_texcoord0);

Animated textures aren’t supported yet in the new studio but in general, we use png sequence animations controlled by either the play animation component or the animation controller

And we also have a touch component to handle touches.

Do you have any simpler examples of shaders that are your work?
