Jump to content

  • Log In with Google      Sign In   
  • Create Account

TeaTreeTim

Member Since 18 May 2009
Offline Last Active Yesterday, 03:36 PM

Posts I've Made

In Topic: Assimp and Skinning transforms

16 August 2016 - 03:45 PM

There's a lot of things that can go wrong. Start with the basics like is the mesh scaled and rotated the same as the armature at identity and are the bone heads where you expect them to be?


In Topic: DirectX11 Multiple Constant Buffer Issue

11 August 2016 - 04:38 PM

Have you tried using b instead of cb?

 

   cbuffer Standard : register(b0)
   {
 
 
   };

In Topic: Random Sky Pixels Shine Through Between Triangles

07 August 2016 - 11:35 PM

It's common practice to not have intersections like that, you would 'stitch'.

This is height map based but the need to stitch is the same. Every big triangle has subdivisions to match the smaller neighbours. If you just moved the smaller ones to be in line with the big triangles there would be errors like you describe

 

WireFrame.jpg


In Topic: Dynamic GPU Instancing

11 July 2016 - 03:44 PM

I sort like this: http://www.socoso.com.au/tiogra/trees.html you could still render as meshes, I just pack em all for simplicity.


In Topic: Subdividing triangles using a GS

28 June 2016 - 04:18 PM

Hi, A long hand version:

PSIn MidPoint(PSIn a, PSIn b)
{
	PSIn result;
	result.pos = (a.pos + b.pos) / 2.0f;
	result.tex = (a.tex + b.tex) / 2.0f;
// project pos to the same radius as the other points here
	return result;
}


[maxvertexcount(8)]
void GS(triangle PSIn input[3], inout TriangleStream<PSIn> triStream)
{
	PSIn pointA = input[0];
	PSIn pointB = input[1];
	PSIn pointC = input[2];

	PSIn pointAB = MidPoint(pointA, pointB);
	PSIn pointAC = MidPoint(pointA, pointC);
	PSIn pointBC = MidPoint(pointB, pointC);

	pointA.pos = mul(pointA.pos, viewMatrix);
	pointA.pos = mul(pointA.pos, projectionMatrix);
	pointB.pos = mul(pointB.pos, viewMatrix);
	pointB.pos = mul(pointB.pos, projectionMatrix);
	pointC.pos = mul(pointC.pos, viewMatrix);
	pointC.pos = mul(pointC.pos, projectionMatrix);
	pointAB.pos = mul(pointAB.pos, viewMatrix);
	pointAB.pos = mul(pointAB.pos, projectionMatrix);
	pointAC.pos = mul(pointAC.pos, viewMatrix);
	pointAC.pos = mul(pointAC.pos, projectionMatrix);
	pointBC.pos = mul(pointBC.pos, viewMatrix);
	pointBC.pos = mul(pointBC.pos, projectionMatrix);


	triStream.Append(pointA);
	triStream.Append(pointAB);
	triStream.Append(pointAC);
	triStream.Append(pointBC);
	triStream.Append(pointC);

	triStream.RestartStrip();

	triStream.Append(pointAB);
	triStream.Append(pointB);
	triStream.Append(pointBC);

	triStream.RestartStrip();
}

Using triangle strip just seems silly to me, I'd use list and it would make more logical sense but the above will work, you'd need to project the mid points to the sphere as well though. I stand by my original point that I think your order is incorrect, and add the second restart strip like I did.


PARTNERS