Shader and APK

When testing my shader I can’t build it to an APK or dmengien:

APK:
error1

dmengien:
error2

But it works on the local build (Ctrl + B)

What is wrong, and how can I fix it?

Can you paste the contents of your game.project file?

What does the console in your browser print when you run an HTML5 build?

When I try to run it on HTML5 I get the same error as APK (No mapping for .PNG)

game.project file: (I changed the render, to render the shader)

[project]
title = Shadertoy sample
version = 0.1

[bootstrap]
main_collection = /main/main.collectionc
render = /main/main.renderc

[input]
game_binding = /input/game.input_bindingc

[display]
width = 400
height = 720
variable_dt = 1

[physics]
scale = 0.02

[script]
shared_state = 1

Look through your project to see if you have selected any .png files in components that should not be listed there. That error message isn’t super clear but it seems to indicate something like that, that a component is improperly setup.

1 Like

The texture I use for my model is a PNG file. If I change that it will work on HTML5 and APK for some reason (even if it is a different PNG), but not for dmengien, same error.

(The png is liked to the material > samplers, left it on default settings)

Could you post screenshots of those settings?

Could the png be malformed / corrupt?

And on the sprite / model component?

here

Try to rename the file so it is “screen.png” and not “screen.PNG”? File extensions for this might be case sensitive.

4 Likes

Well you are right, when I changed it to a .png and not .PNG it worked, but it instantly crashed on the APK version and the screen was compleatly black in the HTML5 build. That seems to be the case for every texture (png and jpg).

1 Like

Could be next an issue with your custom shader. It’s also possible you need to clean your build folder.

1 Like

This is quite likely. If you check with adb tool to get the device log then that might help you pinpoint the problem. And share the shader code here.

2 Likes

This code is a bit messy (want help with Unitquad wants texture (SOLVED) and the dmengien)

New error in dmengien (I changed the shader, works in Ctrl + B):
newerror

Here is the code:
https://docs.google.com/document/d/1XadFW8lfUsxE-VtAuf_lyfYyUY_BxnPRJvlVakVAWF8/edit?usp=sharing
Here is the project:

Maze generator.zip (1007.4 KB)

Here is the project related to this thread:

Shadertoy sample.zip (6.7 MB)

Whoops,

The HTML5 thing was because the shader did not like for loops (that is not defined) and arrays. Don’t know, got it working :slight_smile:

(still get the apk thing)

1 Like

What is the “apk thing”? What does it say? And what does the logcat say?

I can’t run it on android (apk and dmengien)

Have you managed to create an APK?
I assume so, since you mention “I can’t run it on android”

Since you are starting the .apk on your Android, but it apparently fails. HOW does it fail? What error do you get, and where is it displayed? On the screen, or in the logcat? Please provide a bit more info, because it’s very difficult to guess what the actual cause may be.

1 Like

Very confused. Now it works, but very laggy??? It crashed instantly before. I don’t know anything anymore ._.

check the logcat to see if there is any information?