Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 02 Aug 2012
Offline Last Active Sep 02 2014 03:46 PM

Posts I've Made

In Topic: How is the elongated light beam/tentacle effect achieved?

10 June 2014 - 09:46 AM

Most of the time it's much simpler than we imagine.
I think it's static geometry with an animated texture (procedural or pre-rendered as a looping sequence of frames) that is moved with the texture matrix so that it slides along the geometry.
The vertices at the end of the geometry strips have zero alpha, so the effect disappears into the air.


So that's essentially an animated spritesheet on a quad? That seems plausible, but also potentially expensive to render. Some of those animations are pretty detailed and long.


In any case, I am going to give this a shot.

In Topic: SpriteBatch billboards in a 3D slow on mobile device

26 May 2014 - 03:44 PM

The limitation could be memory bandwidth, which is also really low on mobile platforms.


You should also try generating mip maps for your texture, not having them can hurt performance significantly.


EDIT: Well, I actually did try running GenerateMipMaps every frame and the framerate did go up, so that's that. :)

In Topic: SpriteBatch billboards in a 3D slow on mobile device

26 May 2014 - 09:06 AM

Other than Adam's suggestions #2 and #3 there isn't really anywhere else to go other than trying to achieve the same effect with fewer, more opaque particles.


Unlikely, but is there scope for improving your texture at all? e.g. If it's a large 8888 non-mipmapped texture, then you would see gains from switching to a smaller mipmapped compressed texture.


I actually generate the texture like I described above (render models into a render target). I'll play around with lower quality pixel format, but I guess if there are no other suggestions then I'm stuck with it.


The only thing I don't understand is, why is it that reducing the render target size helps if this is a fillrate issue? Or is fillrate a bit more broad than I assume it to be? (Sampling a larger image contributes as well?)

In Topic: SpriteBatch billboards in a 3D slow on mobile device

25 May 2014 - 06:31 PM

I would think that most likely you are fill-rate bound. In the absence of a GPU profiler, the easiest way to confirm whether or not you are fill rate bound is by setting up a scissor rectangle so that only a small area of the screen is visible. For your particular simple case, maybe just make the particles smaller instead of add a scissor rectangle.


If it's not the fill rate, maybe it's the cost of the vertex processing.



Not vertex processing for sure since the aforementioned method does all that on the CPU. That, I managed to measure to ensure that it's not a bottleneck. And yes, reducing what is being drawn on screen increases the framerate.


It sounds very much like you're pixel bound if reducing the size improves the performance. Phone GPUs are horribly slow compared to even a basic PC GPU. Your options are:


1. Simplify the pixel shader. Ideally it'd be a single line of code doing a texture fetch for billboards.

2. Render at a reduced screen resolution, with MSAA on.

3. Render less pixels. For example use extra polys (e.g. octagons instead of quads) to render less transparent pixels. For circles this saves up to about 20%.


Check out http://aras-p.info/texts/files/FastMobileShaders_siggraph2011.pdf for some more info on how phone GPUs perform.


The shader used in that method is BasicEffect, in which I disabled absolutely everything (even vertex color). I am already running at the lowest resolution feasible.


To render less pixels, I also tried to replace BasicEffect with AlphaTestEffect.


It seems that if this is a fillrate issue, the only thing really left is to skip drawing some of those billboards. Luckily, it happens to be that quite a few of them are blocked most of the time. I am not really sure where to start here if this is a solution. Frustum culling is not really the answer here and occlusion querying is unavailable on CPUs like Adreno 225 and less, which I plan on targeting.


Any suggestions?

In Topic: HLSL Shader Library

03 July 2013 - 03:50 PM

At this point shaders are generic programs that you run on the GPU. It's like asking for a C++ code library.

For any non-simple renderer the shader code will completely depend on the overall architecture of the renderer, and not just the visual appearance of whatever you're drawing. In fact a lot of modern shaders don't draw anything at all!


I guess I should have clarified that I was talking specifically about visual techniques and post processing. The Nvidia SDK samples appear to be what I was looking for.