Does pumping parameters on WebGL fx hit GPU/CPU?

Discussion and feedback on Construct 2

Post » Tue May 28, 2013 3:27 am

I didn't know how to phrase the question better, but I am developing a very aesthetic heavy game, with a sizable amount of WebGL fx, I'm naturally trying to keep it at a minimum. It's going to be published on the AppStore once either Ludei's CocoonJS or iOS 7 make WebGL on Apple mobiles possible.

Long story shortish, I was optimizing effects, removing where I can, I started thinking if increasing the value for example Glass WebGL effect "Density" would have a major impact on the GPU/CPU? I want to know if I can play with very big values for WebGL parameters, especially on the glass WebGL fx. I set it up to 10000 right now and I'm getting exactly what I need visually. But the OCD fear is there, that it might be a tumor on the CPU/GPU and slow the game considerably.

Could someone help out an obviously lost man find his path?
I will find the most sublime ASCII cake if I get an answer.

I'm new to Construct 2, but not programing and game dev, I'm loving it almost as much as some of my favorite vital organs.

Thank you
B
33
S
4
G
1
Posts: 272
Reputation: 2,500

Post » Tue May 28, 2013 1:54 pm

The particular value a shader parameter takes usually will have no effect on performance. For example the Glass shader's density can be anything, and exactly the same code runs but just with different values. Usually that means the performance is the same. (It's possible a shader will do something like loop a number of times based on a parameter, but I think most don't do that.)

The act of setting a shader parameter does incur a minor bit of extra CPU overhead. However unless you're really hammering it (e.g. setting 100 different shader parameters every frame) it probably won't be a noticable difference.
Scirra Founder
B
378
S
220
G
84
Posts: 23,868
Reputation: 188,109

Post » Tue May 28, 2013 2:15 pm

This is like honey to my ears. A comfortable and pleasant honey. Which you actually eat via the ears or something.

Thank you Ashley.
B
33
S
4
G
1
Posts: 272
Reputation: 2,500


Return to Construct 2 General

Who is online

Users browsing this forum: jackblord and 7 guests