OcularCash's Forum Posts

  • 14 posts
  • Thanks for the info. Ya I’ll end up figuring some way to do it somewhere down the road. Just keeping it easy for users might be a bit a tricky, but should be doable

  • Definitely understandable and ya, it does work well. If I find a way in the future that doesn’t require additional I’ll add it in but we will see. I’ll just move on to the next effect then. Thanks for your time

  • In the transition effect, I’d like to add the ability to mask out a sprite using the sampled reference sprite. As of right now, it’s good for scene transitions bc it either draws the reference pixel transparent or a color based on how dark the reference pixel is. So let’s say you have an enemy and when he dies, you want him to burn away to transparent (using a cloud texture to sample) or swipe to transparent (using a linear ramp texture to sample), to achieve the effect, when drawing the enemy sprite, you need access and to not only the enemy sprite, but the reference sprite as well, which is normal when dealing with masking effects.

    So my thought was, since you can’t pass in a custom sampler image (binding another image to texture slot 1 or 2), another option would be since the texture is already bound, all I would need is the texture coordinates if the sampler sprite is part of the same sprite sheet. lol ya, I would never make the user manually input the rectangle that’s why I was wondering if it was possible to aquire a predetermined rectangle of another sprite on the sheet so the user doesn’t have to. Another option would be to use the reference location by sampling the sprites neighbor by using vTex.x + uvWidth and have the reference the same size as the sampled sprite. But again, don’t want to do that because I don’t want a bunch things a user has to think about when using an effect.

    It’s not super important, was just curious if there was a something in place that I could grab the reference rectangle from. Otherwise i won’t add it since it’s not really essential and I’ll just start working on the next effect/addon. Thanks Ashley

  • Is it possible to sample a sprite that is not being rendered but using the same texture as the one that is? For instance, I have 5 sprites on a texture (spritesheet) and I’m currently rendering the first sprite in the sheet, is it possible to sample the from the 5th sprite?

    I know if 5 sprites are going horizontal then sprite 5 can be sampled by sampling vTex.x * 5.0 if I’m rendering the 1st sprite. Just wondering if an easier way of doing that besides making the users manually inputting the sampler rectangle if the sprites are not always the same size or layout

  • Thanks. Still have alot of learning to do here. Here's his podcast channel: https://isoe.podbean.com/

  • Omg I can’t thank you enough. I’ve hunted for that since I started. I looked in the docs before but never came across that post. So You can only use float, percent or color as vec3. I always pass Booleans as a float anyways but is there any plans to add more in the future like vec4 or color4 to cut down on so many variables in the editor?

  • I was wonder if there was some kind of list and/or reference to object types I.e. int, vec3, etc.. that can tell me what type are available, to let’s say, pass to the shader when making an effect?

    The only way I’ve noticed I can find out what types are available is to try it over and over with different types (which takes forever I might add bc it has to be changed in three places just so it can compile.. or not) or download a sample project that may or may not be using a similar type.

    For instance, I’m using “color” and setting it’s default to [0,0,0,1] because i need the alpha. It compiled and works but wouldn’t have known if I wouldn’t have tried bc other examples only show [0,0,0]. The only issue is the class, or atleast what’s shown in the editor, it only has 3 values and has no option for users to choose an alpha value. Is it a color3, not a color4? Is there a color4 type?

    Another example is I want to sample one image and test it against another. I know there’s not a texture type bc I tried that and didn’t work/compile. Is there a Sprite type? Image type? And if there is, it’s kind of another guess to what the default is. Would it be “null” “empty” “none”.

    So it would be awesome if there was some kind of list or reference for what types are available, what there default values can be and what’s available in there editor. I feel like I’ve spent the last 4 days just trying to find some kind of reference instead of just going by trial and error of seeing if it’s gonna compile or not

  • Ya I actually just came to construct a couple does ago bc my brother is a huge fan, even does podcasts about construct 3. I usually open glsl in notepad++ But since it has a different extension, I opened it in notepad bc I didn’t know it was a fragment shader until I opened it, I think that was mistake number 1 lmao

    Funny bit of info though, I actually know that shader already. I downloaded a random effect to see how everything was setup and what did what it just so happened to be yours.

    When I’m finished I’m gonna post it. Need sprite transitions as well (so you can transition images to alpha) so there’s a few things more to be added. Still kinda learning the ropes of how construct does things. Mainly I came to construct to make addons for my brother and release them to the community as well

  • Nvm, Its working like it should. Dummy me noticed I put white values in instead of black after I submitted the post, it’s always the little things lol thanks anyways

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So I have a shader that I always use in my own engines that I can use a sample texture to apply transitions and I made a super simple version of it for construct to get used to constructs plugin system and for some reason I just can't get it to work.

    The concept is super simple, pass a cutoff float to the shader and compare the r value of the pixel in a ramp/gradient image and if the cutoff value is lower than the r value of that coordinate, make the color black, if not, make it transparent. But for some reason it is always transparent. I don't know if I'm missing something or what. Any help or information would be greatly appreciated. Here is the code:

    ///////////////////////////////////////////////////////// // Transition effect varying mediump vec2 vTex; uniform lowp sampler2D samplerFront; uniform lowp float cutOff; void main(void) { lowp float pixel = texture2D(samplerFront, vTex).r; lowp vec4 outColor = vec4(0, 0, 0, 0); if(pixel < cutOff) outColor = vec4(1, 1, 1, 1); gl_FragColor = outColor; }

    Tagged:

  • O ok, I understand now. I came across that earlier this morning but skipped over parts of it bc I was understanding “snapshot” as grabbing the screen image and saving it as a file over multiple frames. So snapshot is the passing of buffer data then.

    There’s only a few effects like water trickling down the screen (warping parts of the final image) or security cameras and stuff like that but glad there’s access to that in those occasions. Thank you for the info

  • This is kind of a question that pertains somewhat to a question I made yesterday but is there anyway to access and manipulate screen pixel data during drawing? In my own engines I would draw to a separate buffer, manipulate that buffer (not to the screen), then draw it like you would a sprite (on screen) (aka the rendering pipeline). Just wanted to know if something like this is available.

    I got the answer for per sprite yesterday but I believe I could make some effects more efficient if the final output is manipulated instead of per sprite. Like in the image example on the effects page shows water, but that water calculates all pixels in all sprites, even if it’s an underlying image, to determine whether or not the final pixel will be visible. Where as a screen image manipulation only has to make a single pass at a pixel

    Thanks for any replies and thanks for the other answer on the previous post

  • Thank you the info. Must’ve skipped over that section

  • I’m new to construct and just wanted to ask if there is any support for glsl and if it is possible to retrieve the frame buffer. My html/JavaScript is a little rusty and have been doing more engine/application development in c# and java nowadays but shouldn’t take take too long to get back into js/html. But since I’m coming from my own engines, that also means I’m used to having the freedom of low level pipelines.

    Just wondering if that pipeline is open or not and if so, is there any documentation on accessing it? I’m a huge fan of screen transitions and manipulation so it would be great if there was access to that. Thanks for any comments

  • 14 posts