[DISCUSSION] Are vertex shaders possible?

Share your Construct 2 effect files

Post » Sun Dec 11, 2016 1:19 am

Just starting to get into shader programming and all the examples I've looked at so far are for pixel shaders--is writing vertex shaders for the C2 engine possible? If so, are there any examples I could look at for that?
B
12
S
3
Posts: 39
Reputation: 1,001

Post » Sun Dec 11, 2016 5:38 am

All the effects are just pixel shaders. Vertex shaders applied to quads aren't too interesting so I can see why they wouldn't be included.

Now if you were to learn how to use webgl you conviably could write a plugin that uses a custom vertex shader.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Mon Dec 12, 2016 9:47 pm

R0J0hound wrote:Vertex shaders applied to quads aren't too interesting so I can see why they wouldn't be included.


they give a lot better performance, depending on what you're trying to do. i don't want to do any premature optimization so it's not a particularly high priority but i'd still like to have the option open.
B
12
S
3
Posts: 39
Reputation: 1,001

Post » Tue Dec 13, 2016 1:16 am

C2's render is quad only so the vertex shader would have only 4 vertices to manipulate, so there wouldn't be much variety in shaders. Also there is the overhead of changing the shader and sending the parameters to the gpu. My argument is it would probably be slower with such a low vertex count.

Vertex shaders could be useful if a plugin was made that had a high polygon mesh, but you'd be doing custom webgl to render that anyway so that would be the place to do it.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993


Return to Effects

Who is online

Users browsing this forum: No registered users and 1 guest