Effects. How to reference a second texture

For developers using the Construct 2 Javascript SDK

Post » Sun May 01, 2016 5:19 pm

@chrisbrobs - blast! I forgot about this conversation. I had to drop tinkering with the graphics card to do other things :(.

I just spent the last day and a half figuring out how to do this through trial and error (moslty cause I still know nothing of shaders - I'm like "Hey this should work, the math checks out!" but nope. >.< Well then, thanks for the effort!
Image
B
32
S
11
G
2
Posts: 563
Reputation: 5,106

Post » Sun May 01, 2016 5:56 pm

@R0j0hound - So I checked out your creature plugin, now as I understand it, its not much different than the sprite pluggin in a way right (as far as drawing and textures go)... but I'm confused, because I thought you can't change the editor which would be required for attaching multiple images right?

I mean, is it possible to actually pass another texture to the shaders in c2? (like so that I could have samplerback, samplerfront, samplercustom1, sampler custom2) does this make sense?

And you would have to somehow be able to attach that image in the editor eh?
Image
B
32
S
11
G
2
Posts: 563
Reputation: 5,106

Post » Sun May 01, 2016 10:22 pm

@ruskul
I just saw your post here after replying in that other topic.
Picking multiple textures to use to can be done in events easily. In my paster object the "draw textured quad" action just grabs the texture form some other object you specify. The same thing could be done in this case.

Also to be clear you'd have to run the shader through the plugin instead of using C2's effects. Previewing in the editor wouldn't be possible in C2.
B
89
S
30
G
96
Posts: 5,160
Reputation: 63,956

Post » Mon May 02, 2016 4:20 pm

@R0j0hound - so basically one would have to have a plugin that only does an effect then? (ie for each shader you wanted to make you would have create a plugin for that effect? This is probably way over my head. I think I understand.? This is probably going to take more work than I originally thought at the beginning. I'm trying to decide if its worth it.

I think I like the world of physics engines... you just have to know math... but this architecture stuff frustrates me for some reason.
Image
B
32
S
11
G
2
Posts: 563
Reputation: 5,106

Post » Tue May 03, 2016 12:58 am

@ruskul
Ideally you'd just make one plugin. A simplish design would be the make it an object you can put on the layout with zorder. That would mark where the effect would be applied. The plugin by default wouldn't have a effect loaded so it would do nothing when it draws. You'd load an effect as some text with an action which would compile the effect so it can be used. Then you'd need an action to set texture parameters and number parameters. That would give you a way to do full screen effects. Not terribly hard, just need an evening of motivation to put it together.
B
89
S
30
G
96
Posts: 5,160
Reputation: 63,956

Previous

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests