extra textures/ store data?

Share your Construct 2 effect files

Post » Tue Sep 06, 2016 6:30 am

Is it possible to use textures to store data that can be used in a shader for construct2?
I'd want to read/write to a texture, etc. I know it can be done in glsl, but was wondering if construct 2 prevents this(because you have to set active buffers, etc).
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Tue Sep 06, 2016 3:54 pm

C2 doesn't prevent it, it just wasn't designed to do it. This would have to be done by either modifying C2's runtime (which I'd leave to Ashley if it was ever to be added) or run custom webgl from a plugin's drawgl function.

To do it it would basically just require you to set a uniform after an effect was made active. There isn't a spot you can do that in conjunction with C2's effect rendering code.

That said you can do anything in the drawgl function in plugins, you just need to restore any webgl state changes before exiting the function. The idea is you'd bypass c2's system for using effects and doing it manually.
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507

Post » Tue Sep 06, 2016 6:35 pm

okay, thanks.. I'll take a look through some plugins and see if I can wrap my head around how to organize it.
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Tue Sep 06, 2016 7:40 pm

The only plugin to do custom webgl like that is this one:
plugin-span-class-posthilit-creature2d-span_p997794?#p997794

It doesn't replace the shaders, but it does change the vertex data.
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507


Return to Effects

Who is online

Users browsing this forum: No registered users and 0 guests