Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] Problem with Sprite Shader in AGK Studio

Author
Message
Albatros
9
Years of Service
User Offline
Joined: 2nd Oct 2015
Location:
Posted: 18th Jun 2025 00:40
Hello everyone!

Has anyone encountered a similar problem?

I wrote a simple shader that draws a filled figure on the screen.

On AppGameKit Classic it works perfectly, but on AppGameKit Studio the figure is deformed. I can't figure out the cause of this problem.

An array of points describing the contour is passed to the shader. Pixels that fall inside the contour should be drawn in color, and pixels that do not fall are rejected.

Why doesn't this work on Studio? I tried to enable Vulkan render, OpenGL, tried to split the array into two one-dimensional (float), tried to use gl_FragCoords instead of UV. Nothing helps. It seems that Studio passes incorrect data about the sprite to the shader...

Shader Code:


Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

blink0k
Moderator
12
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 20th Jun 2025 06:19
This post has been marked by the post author as the answer.
I had to ALWAYS use a vec4 when setting variables from AGK. Probably my naivety but that was my experience.
Albatros
9
Years of Service
User Offline
Joined: 2nd Oct 2015
Location:
Posted: 21st Jun 2025 20:17
Wow, this solved my problem!!! You are a genius! Thank you so much, you saved my project!!!

Login to post a reply

Server time is: 2025-06-24 11:45:50
Your offset time is: 2025-06-24 11:45:50