Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Corefanatic

Member Since 09 Apr 2010
Offline Last Active Feb 18 2014 08:06 AM

Posts I've Made

In Topic: AMD's Mantle API

03 February 2014 - 06:29 AM

Some developers, including the one I work for, have been given access to the API documentation so that we can get a better idea of whats coming. I think that AMD developer partners will get access to the API before/around GDC and public release later in the year as mentioned in this thread.


In Topic: AMD's Mantle API

27 September 2013 - 06:10 AM

For people wondering what the point of this API is, my hopes/predictions for the API would include:
• a more 'stateless' API, where different threads can all produce independent command buffers, with no state leakage between them. Muti-core graphics submission can be implemented entirely by the user.
• a focus on command buffers as the main primitive. Much like network programming, where you're writing packets into buffers. The mapping between 'calls' and 'packets'/bytes being explicit.
• still having validation and virtual memory so user-code cant corrupt/crash the OS or other apps.
• user-mode access to GPU RAM. The ability to malloc/free GPU RAM. When you create a resource such as a buffer or texture, you'll be able to specify the memory location to be used.
• fine grained synchronization primitives to make the GPU wait on CPU jobs, and vice versa.
• an offline version of the API, where you can make graphics calls ahead of time, producing a command buffer that can be saved to disc.
• full support for aliasing resources, e.g. Creating a vertex buffer and a 2D texure and a render-target at the same memory address.
• explicit allocation and control of render-target companion/meta-data, such as Hi-Z, fast-clear and MSAA compression buffers.
• a shader compiler specific able to precompile ready-to-use binaries.

 

This is my dream...


In Topic: AMD's Mantle API

26 September 2013 - 06:49 AM

Interesting situation would be if Nvidia came out with similar low level API.

 

Also, I am wondering if this will let developers have control over CPU-GPU synchronization. If it did and developers could tightly control when and how data is transferred to and from the GPU, this would be a real winner.   


In Topic: Normal Interpolation issues on my generated terrain

24 January 2013 - 05:04 PM

It could also be that I'm misunderstanding what you're complaining about.

 

Sometimes people build their terrain such that the vertices look like:

 

pW3fUDy.jpg

 

Whereas you can avoid some artifacts on terrain lighting if you structure your vertices like:

 

ZO7pxKa.jpg

 

n!

 

So, I tried building the mesh as in the second image, unfortunately the problems did not go away. 

 

16x16 mesh:

 

Dx11FW%202013-01-24%2022-50-58-53.png

 

normals:

 

Dx11FW%202013-01-24%2023-01-47-90.png


In Topic: Normal Interpolation issues on my generated terrain

24 January 2013 - 03:34 PM

Have you tried with different light directions? The dark areas simply look like they are dark because they are facing away from the parallel light you have hard-coded in your shader (ie. the dark sections are always on the -z axis in your image).

 

It may also be worth outputing the normal to the frame buffer so you can visually see any issues with the interpolation.

 

eg: change your color computation (in the pixel shader to) to:

 

color = normal * 0.5f + 0.5f;

return color;

 

You can also change your light vector so that it's always directly above the terrain (float3 toLight = float3( 0.0f, 1.0f, 0.0f );) which should give you a more even lighting across the terrain, again helping to see any issue with the normals. With the off-center light angle, it makes it difficult to say what is wrong really sorry smile.png But, certainly, your shader code looks fine. If it isn't the light direction confusing you, then it maybe the normals themselves.

 

My first guess is just that the light is at an angle really ;)

 

n!

 

Setting the light to 0,1,0 doesn't help, the problem persists. Rendering the normals into the frame buffer shows the same problem.

 

 

 

It could also be that I'm misunderstanding what you're complaining about.

 

Sometimes people build their terrain such that the vertices look like:

 

pW3fUDy.jpg

 

Whereas you can avoid some artifacts on terrain lighting if you structure your vertices like:

 

ZO7pxKa.jpg

 

n!

 

I am building the mesh the way shown in the first picture, will try the other way that thanks.

 

 

From your shader code, it looks like you are doing this correctly (although you could remove the normalize call on the normal vector in the VS since you renormalize in the PS after rasterization).  My guess is that your terrain is defining three vertices for each triangle face, rather than one vertex at each grid point.  You can verify this by checking the number of vertices  you are passing in with your draw call, or you can also check this with PIX/Graphics Debugger to see how many primitives are generated from how many input vertices.

 

So, I moved the rendering into indexed rendering, so there is only one normal per vertex and still get same result. 

 

That may or may not mean that there is exactly one vertex normal being used at each grid point.  How many vertices are in your vertex buffer, how many indices in your index buffer, and how many primitives are you drawing?  Compare that with your grid size and make sure that you only have N+1 x N+1 vertices for a grid of size N x N.

 

For a 16x16 grid, there are 256 vertices, index buffer holds 1350 indices


PARTNERS