# (SOLVED) Using custom fragment program work on computer but give black screen on android

**URL:** <https://forum.defold.com/t/solved-using-custom-fragment-program-work-on-computer-but-give-black-screen-on-android/76398>\
**Category:** Questions\
**Created:** [March 23, 2024, 5:04pm UTC](https://forum.defold.com/t/solved-using-custom-fragment-program-work-on-computer-but-give-black-screen-on-android/76398 "2024-03-23T17:04:43Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [March 23, 2024, 9:50pm UTC](https://forum.defold.com/t/solved-using-custom-fragment-program-work-on-computer-but-give-black-screen-on-android/76398/7 "2024-03-23T21:50:06Z")

</div>

Hi @Karol_Wolonciej 😉

> [@Karol\_Wolonciej](#):
>
> I have fragment shader code like this

First of all, just to clarify, it’s a vertex program 😉 And there isn’t much issue in here, it’s the rest of the project. There are several issues in the repro. It is not building on Windows.

One issue is regarding not existing functions, like `texture()` - there is `texture2D()`, you might want to use. And not existing/defined uniforms, e.g. texture(iChannel0, reflect\_direction) - this is common, when using code from Shadertoy, because it defines different names, check out my issues here:

> [@Shadertoy - uniform variables needs explanation (SOLVED)](https://forum.defold.com/t/shadertoy-uniform-variables-needs-explanation-solved/25559):
>
> Hi, So I’ve tried with Defold Shadertoy tutorial and it’s ok, everything is clear here for me, more or less. But when it goes to implement different shader for example [Raindrops](https://www.shadertoy.com/view/XslcWn) it’s a bit harder. I’ve managed to change resolution and time for Defold but what about other uniform variables like iChannel0? Could you please help me with this one and maybe explain more about how you deal with them in other cases? Following that, I think I will be able to overcome these warnings and understand what…

In rest of the materials, many times materials have incorrectly defined constants or samplers, like for example empty string used for sampler name here:

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/3X/9/5/95842390a420a59f4d8f01ca7360dbdb2261649d.png)

Check out the manual first: (sadly, it’s the one I didn’t translate to Polish yet ☹ )

> **[Defold materials manual](https://defold.com/manuals/material/)**
>
> This manual explains how to work with materials, shader constants and samplers.

and maybe my tutorial:

> **[Shaders for Beginners](https://defold.com/2020/10/19/Shaders-for-beginners/)**
>
> In this guest post we invited Pawel Jarosz, developer of Witchcrafter - Empire Legends, to share his experience learning shader programming.

P.S.  
I’m also working on updating [Defluid](https://github.com/paweljarosz/defluid/tree/master/defluid) example slowly, sadly very slowly, so if you want to rely on me here, you have to be patient, as I have really tight schedule already ☹ It can be done way better now with all the new features in Defold, especially custom vertex attributes.

Explain to me or us here the final effect you want to achieve and we’ll try to help 😉

---

_[View the full topic](https://forum.defold.com/t/solved-using-custom-fragment-program-work-on-computer-but-give-black-screen-on-android/76398)._
