Might sound like a stupid question, but how do i change the effects paramiters on the fly to create movement (ripples or waves)? I've tried set effect paramater> "Amplitude Y" and so on but it seems to have no effect. :(
Printable View
Might sound like a stupid question, but how do i change the effects paramiters on the fly to create movement (ripples or waves)? I've tried set effect paramater> "Amplitude Y" and so on but it seems to have no effect. :(
Also... when you say change one letter...where do you mean? Do you mean alther an actual text file to basically create a horizontal version or am I missing something in a paramiter which seem to be only number related?
HolyMonkey I mean the source code of the effect. :P You'd need to change Y to X somewhere... but forget about this. Just use the Under water shader!
Anyway, here's what you do: Open the effects dialog (Where you choose the effect, click on the one you want, and then, in that info box on the bottom of the dialogue, there's a list of parameters (fX,fY,fAmplitude....), you need to figure out which variable belongs to which parameter.
wait wrong topic
I would personally not involve bending the object or using pixel shaders. I usually don't go for the fancy solutions.
I'd solve it like this, it's a simple rotation.
Pixel shaders are simpler and more resource friendly then a simple rotation, unless your rotation is an animation.
Okey, I've benchmarked it.
Graphics card: ATI Mobility Radeon X1350
Test 1:
2000 Objects
Object size: 32x32
Pixel shader: None
Rotation: None
Average framerate: 260fps
Test 2:
2000 Objects
Object size: 32x32
Pixel shader: None
Rotation: Continuous rotation of all objects, each object has a different angle.
Average frame rate: 175fps
[color:#FF0000]Note: From the process viewer, the framerate seems to be capped by the CPU, not by the graphics card, it takes a lot of processing power for MMF2 to evaluate the rotation expression 2000 times, and apply it to the object angles. This suggests that I'm still not hitting the GPU limitation.[/color]
Test 3:
250 Objects
Object size: 32x32
Pixel Shader: Blend Shader Example
Rotation: None
Average frame rate: 9fps
Conclusion:
A rotation is at least 160 times more resource efficient than a very basic pixel shader.
Now, I had more or less expected this result. If you think about it, in MMF2 HWA, each object is afaik a polygon with a texture applied to it. In a real 3D game, it's extremely rare to see a polygon head-on with no rotation, they're almost always seen from some kind of perspective, so graphics cards are logically built to handle this very quickly.
Aren't graphic cards built to handle pixel shaders quickly too? Also, how did you manage to get only an average framerate of 9fps with pixel shaders on 250 objects? I haven't experimented with this yet, but that seems unusually slow to be honest.
Ouch! My mistake, I had used the blend coefficient, it was causing the slowdown. I get a lot faster speeds when I assign pixel shaders, without using that, but the average is 25fps for 2000 objects that doesn't move (I tested the monochrome shader this time) compared with the 175fps that I got with rotations (which was capped by the CPU and not GPU due to the MMF2 events, so we know the GPU could handle more).
HWA is optimized to handle pixel shaders nicely but if you think about, in a 3D landscape, far from every polygon has a pixel shader assigned to it, but every single textured polygon is seen from a perspective and a 3D game today can have ten thousands of those visible on the screen at the same time (probably even a lot more) so it's very logical that displaying a polygon with a different rotation or from a different perspective must be a lot faster.
Good solution, Nifflas! Thanks for sharing!