View Issue Details

IDProjectCategoryView StatusLast Update
0018444Runner[All Projects] ShadersPublic2016-11-30 14:38
ReporterGamerXPAssigned ToMike Rennie 
Status ClosedResolutionFixed 
Platform OS OS Version
Product Version 
Target VersionFixed in Version 
Summary0018444: Suggestion: Shaders: Shader Callback to return the current shader
DescriptionHello. When I was making an custom drawing system for GM, I found some inconvinient parts about it. And I got some suggestions for the future:

Just a simple function, that will return index of currenlty used shader. That will be convinient to have if you want to check if shader was changed. Maybe even a callback event for changing shader as well, but it's less critical.

Why? Let's say you want to update uniforms if shader was switched. Making own global variable for currently used shader will work as long as you use only your own shader switching functions. But you can't say if user won't change shader using shader_set somewhere outside. And there is no way to check it right now.
Additional InformationOriginal helpdesk ticket:
1.4 Found In1.4.1598
2.x Runtime Found In
2.x Runtime Verified In


Russell Kay

2016-09-02 10:56

Manager   ~0048108

We should have a shader_current() or some such allowing us to get the currently set shader


2016-09-02 11:41

Reporter   ~0048131

Will be nice to have.
Also, sorry to write it here, but those are connected issues (at least for me):
This one got closed for not good reason, and I can't add a comment myself.

"sprite_get_texture will return the texture on which that frame of the sprite exists - different frames may be on different textures"
It returns different results even if sprites are on same page.

Mike Rennie

2016-10-18 15:02

Developer   ~0049734

I've added the shader_current() function which returns the currently set user shader.