• Create Account

# TheKreature

Member Since 24 Mar 2006
Offline Last Active Jun 13 2016 10:21 AM

### In Topic: Kinect depth problem

04 March 2016 - 05:02 PM

NUI data is 16 bits with 3 reserved bits for player masks.

I.e., the conversion looks like: (((unsigned short*)depthPixels)[(((i * depthWidth)+j))] >> 3)

Which means that if you want to destroy your data and convert to 8 bit, that you need to scale by 2^13-1 instead of 2^8-1.

awfulDepth = (((kinectDepth >> 3) / 2^13-1)) * (2^8-1).

Why on earth you would want to do this is beyond me, but good luck.

### In Topic: Detecting Boundaries in triangles with adjacency

15 February 2016 - 10:13 AM

I finally found some time to check on this.

For the curious:

My assumption that -1 was being set for invalid adjacency indices was incorrect.

`indicesAdj[ outputi ] = indices[ face * 3 + ( ( point+2 ) % 3 ) ];`

The boundary check is:

```uint invalidAdjId = ( uint )fmod( ( index1+4 ), 6.0f );
if ( vecDistance( worldPosition[ index1+1 ], worldPosition[ invalidAdjId ] ) < 1e-6f )
emitLine();
```

### In Topic: Detecting Boundaries in triangles with adjacency

22 January 2016 - 01:05 PM

You can grab the index in the vertex shader with SV_VertexID and pass it along. Maybe that helps.

Interesting thought.

The vertex shader would only run on vertices present in the vertex buffer though .

What I'm really interested in is what the gpu does with indices that are -1 when forming the input vertices for triangleadj:

```[maxvertexcount(MAX_VERTEX_COUNT)]
void gs( triangleadj vertex input[6], inout TriangleStream<vertex> triStream )
```

Mind you, this approach would definitely be a faster method of testing if I were to replace the -1 adjacency indices with index-1 when I compute the adjacency buffer.

```for (uint id = 0; id<6; id+=2)
{
uint index0 = (uint)fmod( id, 6.0f );
if (input[index0].vertexId == input[index0+1].vertexId)
emitLine();
}
```

### In Topic: Tool release for physically based rendering

21 November 2014 - 10:00 PM

If you are looking for just a baker, this guy is doing some amazing work:

https://github.com/dariomanesku/cmft

### In Topic: Tool release for physically based rendering

21 November 2014 - 03:20 PM

This was the bit I was missing when I first looked at it. The description kind of reads like it's a cubemap generation tool. I thought to myself "well, this is great until the surrounding environment changes". I see now it's meant not only to be a standalone tool, but also an example of how to implement these methods. That's excellent, thanks for this =) I will have to look through the code.

Yeah, I should probably overhaul the home site and the description to better communicate this.

Thanks for pointing this out!

PARTNERS