Jump to content

  • Log In with Google      Sign In   
  • Create Account


bronxbomber92

Member Since 08 Oct 2006
Offline Last Active Nov 30 2012 08:58 PM
-----

Posts I've Made

In Topic: Asynchronous Loading - Dependencies?

23 August 2012 - 11:48 AM

Thanks Hodgman. The only part I'm missing is that without parsing a material, for example, I can't tell what shaders it references. So I guess the parse() method will need to be able to back out and say "I'm missing these dependencies". It could then be pushed to the back of the batch, after the dependencies it needs.

Why not just load all shaders at once and ensure it happens before material resource loading? You possibly might get speed improvements this way too, since you'll have better instruction cache coherency and the shader compiler may under the hood be able to do multiple shader compilations in parallel.

In Topic: Why do I need GLSL?

23 August 2012 - 02:15 AM

I don't understand why I need to learn GLSL.
What are some stuff that is not possible to do in normal OpenGL, but possible with GLSL

For modern OpenGL development there is no practical difference between GLSL (or more broadly, shaders, for which GLSL is a language to write shaders) and OpenGL.

Originally when OpenGL was conceived graphic processing units were only capable of performing a fixed-set of operations. Thus, OpenGL's API was designed to only expose what the graphic cards were capable of doing, and this it what came to be called the fixed function pipeline. But as time has passed, graphic processing units have evolved. They no longer expose just a fixed-set of operations; they still have a small set of fixed operations, but now also include the ability to be programmed (similar to how we can program our CPUs with C or C++ or Java or <insert favourite language>). The ability to program a GPU is important because now what is possible to do with a GPU is much less limited. However, we need a way to be able to program the GPUs, and hence OpenGL has evolved alongside the GPUs capabilities; this is why shaders were introduced.

The bottom line is that GLSL is only necessary to learn if you intend to use features that are beyond the capabilities of the fixed function pipeline. Vaguely, the fixed function pipeline is only capable of fog, vertex lighting, coloring, and texturing. If you're requirements are more sophisticated than that, then you need shaders.

In Topic: Asynchronous Loading - Dependencies?

22 August 2012 - 09:42 PM

Perhaps the easiest solution is to have a serial queue of resource loading requests that's get consumed by a second thread that is concurrent to your main thread. Just enqueue each resource in the same order as your original synchronous code and your resource loading is now synchronous relative to other resources being loaded. A callback notification system can then easily be created on top of this so other parts of your application will know when the resource's they need have been loaded.

In Topic: Horrible performance or not ?

19 August 2012 - 03:32 PM


There's no point clearing any buffer that you're going to overwrite the contents of later on. Assuming that geometry always fills your entire screen, then new geometry is going to fill your g-buffer anyway, so clearing it is a waste of time.


In this case and in general this is true.

However, there is a point clearing the render targets and that is the case when using SLI/Crossfire setup. That is one of the ways that the driver is able to recognize which surfaces aren't needed by the other GPU and may skip the transfer of framebuffer between the GPU memories. So keep your clear code there for the case when number of GPUs is bigger than 1.

Otherwise, you may save some bandwidth if you use the hardware z-buffer for position creation instead of using another buffer for depth. The quality isn't as good, but should be enough for typical scenarios.

Best regards!

That is the first time I've heard that, can you elaborate why ?

There's no point clearing any buffer that you're going to overwrite the contents of later on. Assuming that geometry always fills your entire screen, then new geometry is going to fill your g-buffer anyway, so clearing it is a waste of time.


There's another reason to clear render targets on tiled architecture GPUs that are prevalent on mobile devices; according to Unity's talk at Siggraph this year, clearing render targets can avoid extra copies done by the driver. So if I'm reading the slides correctly, the render target clear can act as an equivalent of EXT_discard_framebuffer operation on devices that don't expose that extension.

In Topic: Good article on Drawing Policy

16 June 2012 - 07:00 PM

Christer Ericson has a good write-up on his blog about the bucket-sorting approach he used in God of War 3: http://realtimecollisiondetection.net/blog/?p=86

PARTNERS