Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 23 Mar 2010
Offline Last Active Jun 04 2016 06:49 AM

Posts I've Made

In Topic: Camera axis always inverted somehow

12 February 2013 - 09:23 PM

try removing the transpose from this line


XMStoreFloat4x4(&pTransformData->WorldViewProjection, XMMatrixTranspose(worldViewProj));


making it


XMStoreFloat4x4(&pTransformData->WorldViewProjection, worldViewProj);

In Topic: Increasing Line Length

11 January 2013 - 09:53 PM

to make any ray longer, you just multiply if by a scalar.


Meaning, if you have a ray, and you multiply it by two, the ray is twice as long . . .

In Topic: Problems Porting Eric Bruneton's Water to XNA

01 January 2013 - 11:23 AM

I successfully ported his examples to directx and ran into the same issues. Unfortunately, there were several places where the y and z components needed to be flipped. Both in the vertex shader and the pixel shader. First, get your vertex shader to draw properly.


Swap your final output y and z components in the vertex shader( but before you transform the vertex so the transform is correct).

This will mess up your pixel shader. So try swaping the z and y components back at the beginning of the pixel shader.

Then, make sure to swap the z and y components of anything externally set and used in all of the shaders, i.e. cameraposition, sunnormal

In Topic: Compile errors

26 December 2012 - 08:58 PM

This just means that the function

bool InitializeDirect3d11App(HINSTANCE__ *)

that is used in your

_WinMain function is never defined anywhere


It is called, but the compiler cannot find the actual function definition.

In Topic: SSAO and skybox artifact

07 December 2012 - 09:07 AM

When dealing with shaders, ALL code is executed, including ALL branches, all function calls, etc. The ONLY exception for this is if something is known at compile time that will allow the compiler to remove a particular piece of code.

This is how all graphics cards work, AMD, NVIDIA, etc. So, your additional cost is of the if statement, and in your example, you are adding an extra if instruction. This is a zero cost on gpus. If you want to read on it, check out vectors processors and data hazards.

If you somehow split our shader up and added an if statement to the middle thinking that it would speed up your code, you would get NO speedup. because ALL paths will be executed.