More pages: 1 ...
11 ...
13 14 15 16 17 18
19 20 21 22 23 ...
31 ...
41 ...
51 ...
61 ...
71 ...
81 ...
91 ...
101 ...
111 ...
121 ...
131 ...
141 ...
151 ...
161 ...
171 ...
181 ...
191 ...
201 ...
211 ...
221 ...
231 ...
241 ...
251 ...
261 ...
271 ...
281 ...
291 ...
301 ...
311 ...
321 ...
331 ...
341 ...
351 ...
361 ...
365
Query Failed
CeeJay.dk
Thursday, April 11, 2013
Awesome tips. I've already begun using some of them.
Some tips of my own:
If you want to do smoothstep(0,1,x) , then instead do x * x * (3 - 2 * x) . It will be slightly faster.
Hmm thinking of it now, I think -x * x * (2 * x - 3) might be slightly faster but I will need to get home so I can verify this with GPU Shaderanalyzer.
Also you often need to compare the length of a vector to a value and often people do pythagoras:
if (sqrt( dot(vector,vector) ) < threshold)
Instead try:
if (dot(vector,vector) < (threshold * threshold))
because it's faster do the square of the threshold (especially if it's a constant) than do a sqrt()
Humus
Wednesday, April 10, 2013
Sometimes it improves readability, sometimes makes it worse, depending on what's most intuitive for the situation. Sometimes I clarify with a comment, or just put the original or more naive expression in a comment. Sometimes it's just a matter of rewriting the shader to be more readable. For instance,
const float start = 0.7f;
const float slope = 3.2f;
return (x - start) * slope;
turns into:
const float start = 0.7f;
const float slope = 3.2f;
const float bias = -start * slope;
return x * slope + bias;
Dan Y
Tuesday, April 9, 2013
Great stuff, thanks for posting these. Some of the transformations done on simple equations to get them into optimized forms cut down on "readability". Do you ever find yourself putting the original naive implementation in comments near the optimized versions, or is it just something people need to get used to?
fursund
Thursday, April 4, 2013
Thanks!
Humus
Thursday, April 4, 2013
They just went online yesterday.
fursund
Wednesday, April 3, 2013
Hi!
Went to your talk, I really liked your focus! Though I tried to write down as much as I could from you presentation, it would be awesome to have your slides as reference. Any chance you can put the online?
Thanks!
Venkatesh SC
Tuesday, March 26, 2013
Hearty Congratulations.
MrPapillon
Monday, March 25, 2013
Cool, great news for Avalanche that is one great studio if you're a gamer.
More pages: 1 ...
11 ...
13 14 15 16 17 18
19 20 21 22 23 ...
31 ...
41 ...
51 ...
61 ...
71 ...
81 ...
91 ...
101 ...
111 ...
121 ...
131 ...
141 ...
151 ...
161 ...
171 ...
181 ...
191 ...
201 ...
211 ...
221 ...
231 ...
241 ...
251 ...
261 ...
271 ...
281 ...
291 ...
301 ...
311 ...
321 ...
331 ...
341 ...
351 ...
361 ...
365