Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#ActualMigi0027

Posted 13 August 2013 - 03:50 AM

Well after countless tries, I can't seem to solve the jumping of vertices.

output.position = output.position / output.position.w;

When this line is removed the problem no longer persists, but again, that creates another issue as the map doesn't become correct.

Creation of D3D11_RASTERIZER_DESC :
D3D11_RASTERIZER_DESC rasterizerState;
rasterizerState.FillMode = D3D11_FILL_SOLID;
rasterizerState.CullMode = D3D11_CULL_BACK;
rasterizerState.FrontCounterClockwise = false;
rasterizerState.DepthBias = false;
rasterizerState.DepthBiasClamp = 0;
rasterizerState.SlopeScaledDepthBias = 0;
rasterizerState.DepthClipEnable = true;
rasterizerState.ScissorEnable = true;
rasterizerState.MultisampleEnable = false;
rasterizerState.AntialiasedLineEnable = false;

dev->CreateRasterizerState(&rasterizerState, &RsRMAP);

Shader work:

VS
output.position = mul(position, worldMatrix);
output.position = mul(output.position, viewMatrix);
output.position = mul(output.position, projectionMatrix);

output.position = output.position / output.position.w;

// The decider between the front and back side
output.position.z *= _dpmSetting; // 1 front || -1 back

// Determine the distance between the paraboloid origin and the vertex.
float L = length( output.position.xyz );

// Normalize the vector to the vertex
output.position = output.position / L;

// Save the z-component of the normalized vector
output.z_value = output.position.z;

output.position.z = output.position.z + 1;
output.position.x = output.position.x / output.position.z;
output.position.y = output.position.y / output.position.z;
output.position.z = (L - 0.1)/(500.0-0.1);

output.position.w = 1;

PS
clip( input.z_value );

Now what on the earth have I done wrong... again... happy.png


#2Migi0027

Posted 13 August 2013 - 03:49 AM

Well after countless tries, I can't seem to solve the jumping of vertices.

output.position = output.position / output.position.w;

When this line is removed the problem no longer persists, but again, that creates another issue as the map doesn't become correct.

 

Creation of D3D11_RASTERIZER_DESC :

D3D11_RASTERIZER_DESC rasterizerState;
rasterizerState.FillMode = D3D11_FILL_SOLID;
rasterizerState.CullMode = D3D11_CULL_BACK;
rasterizerState.FrontCounterClockwise = false;
rasterizerState.DepthBias = false;
rasterizerState.DepthBiasClamp = 0;
rasterizerState.SlopeScaledDepthBias = 0;
rasterizerState.DepthClipEnable = true;
rasterizerState.ScissorEnable = true;
rasterizerState.MultisampleEnable = false;
rasterizerState.AntialiasedLineEnable = false;

dev->CreateRasterizerState(&rasterizerState, &RsRMAP);

Shader work:

VS::
output.position = mul(position, worldMatrix);
output.position = mul(output.position, viewMatrix);
output.position = mul(output.position, projectionMatrix);
 

output.position = output.position / output.position.w;

 

// The decider between the front and back side

output.position.z *= _dpmSetting; // 1 front || -1 back

 

// Determine the distance between the paraboloid origin and the vertex.

float L = length( output.position.xyz );

 

// Normalize the vector to the vertex

output.position = output.position / L;

 

// Save the z-component of the normalized vector

output.z_value = output.position.z;

 

output.position.z = output.position.z + 1;

output.position.x = output.position.x / output.position.z;

output.position.y = output.position.y / output.position.z;

output.position.z = (L - 0.1)/(500.0-0.1);

 

output.position.w = 1;

 

PS::

clip( input.z_value );

 

Now what on the earth have I done wrong... again... happy.png


#1Migi0027

Posted 13 August 2013 - 03:47 AM

Well after countless tries, I can't seem to solve the jumping of vertices.

output.position = output.position / output.position.w;

When this line is removed the problem no longer persists, but again, that creates another issue as the map doesn't become correct.

 

Creation of D3D11_RASTERIZER_DESC :

D3D11_RASTERIZER_DESC rasterizerState;
rasterizerState.FillMode = D3D11_FILL_SOLID;
rasterizerState.CullMode = D3D11_CULL_BACK;
rasterizerState.FrontCounterClockwise = false;
rasterizerState.DepthBias = false;
rasterizerState.DepthBiasClamp = 0;
rasterizerState.SlopeScaledDepthBias = 0;
rasterizerState.DepthClipEnable = true;
rasterizerState.ScissorEnable = true;
rasterizerState.MultisampleEnable = false;
rasterizerState.AntialiasedLineEnable = false;

dev->CreateRasterizerState(&rasterizerState, &RsRMAP);

Shader work:

PS::
output.position = mul(position, worldMatrix);
output.position = mul(output.position, viewMatrix);
output.position = mul(output.position, projectionMatrix);

output.position = output.position / output.position.w; // The decider between the front and back side output.position.z *= _dpmSetting; // 1 front || -1 back // Determine the distance between the paraboloid origin and the vertex. float L = length( output.position.xyz ); // Normalize the vector to the vertex output.position = output.position / L; // Save the z-component of the normalized vector output.z_value = output.position.z; output.position.z = output.position.z + 1; output.position.x = output.position.x / output.position.z; output.position.y = output.position.y / output.position.z; output.position.z = (L - 0.1)/(500.0-0.1); output.position.w = 1; PS:: clip( input.z_value );

 

Now what on the earth have I done wrong... again... happy.png


PARTNERS