# sensate

Member

194

576 Good

• Rank
Crossbones+

• Website
1. ## Kinect depth problem

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.
2. ## Detecting Boundaries in triangles with adjacency

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. For invalid adjacencies, DirectXMesh will set invalid adjacency indices to: 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();
3. ## Detecting Boundaries in triangles with adjacency

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 :p. 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(); }
4. ## OpenGL Detecting Boundaries in triangles with adjacency

I have been working with geometry shaders and triangles with adjacency for a number of years. I only just had the case where I want to detect boundaries (-1 in indices 1, 3, 5, given triangle with adjacency indices 0,1,2,3,4,5)...   I am wondering what the input assembler does with invalid (value -1) indices and what is the best way to go about detecting them would be? I haven't found anything in the OpenGL or D3D11 docs regarding this, and a few tests including:   - Comparing epsilon in distance(input[index0], index[index0+1]) < 1e-6f (I.e., for edge 0, indices 0, 1) - Comparing epsilon in distance(input[index2], index[index0+1]) < 1e-6f (I.e., for edge 0, indices 2, 1) - Comparing epsilon in distance(input[index0+1], input[index2+1])) < 1e-6f (I.e., for edge 0, indices 1 and 3). - Testing for NAN in incoming positions in indices 1, 3, 5. I.e., input[index0+1].worldPosition != input[index0+1].worldPosition, or isnan(input[index0+1].x)   These tests haven't yielded any output for what should be boundary indices. Obviously, I can scan my adjacency buffer on the system side for -1, and set invalid adjacency indices to [index-1], but I'm now kinda curious as to what the input assembler is doing.   Does anyone know how to test for this?     Adjacency Ref:

6. ## Dynamic vertex pulling with D3D11

Nice work. Thanks for sharing! I did something similar a couple of years ago for a dynamic mesh sampling algorithm I was working on: https://vimeo.com/66923505   While this approach is cool, I am now working on a "nanomesh" style implementation for skinned characters and have been thinking about using the compute shader to generate the transformed vertices from a single source mesh instance, and the required transforms per mesh instance.

8. ## Tool release for physically based rendering

If you are looking for just a baker, this guy is doing some amazing work: https://github.com/dariomanesku/cmft
9. ## Tool release for physically based rendering

Yeah, I should probably overhaul the home site and the description to better communicate this. Thanks for pointing this out!
10. ## Tool release for physically based rendering

I would suggest reading the Epic slides and course notes for a more detailed overview: http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf   And for some pretty pictures: http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_slides.pdf   The supplied code can be used to generate static maps or in realtime to dynamically generate maps (you would render the scene to the source cubemap (optimally, invalidated by some cache key) ) and run the convolution stage on the source cubemap to generate the specular roughness and diffuse irradiance cubemaps. A more optimal (but slightly less accurate) approach for diffuse would be to use spherical harmonics. Dynamic generation of the specular preconvolved cubemap for dynamic lighting works very will when paired with http://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/   An example of convolution for dynamic lighting can be found in a very old demo I did for an older presentation. (the PBR implementation was my first attempt and is incorrect):  [media]https://vimeo.com/81872845[/media]    IBLBaker currently projects a sphere with the lighting environment represented as a HDR image to the source cubemap that is then importance sampled. A more complete implementation would render the virtual scene to the source cubemap. The code that youneed to do this is already in the project.  The provided code will work for both static and dynamic cases.    The other alternative to preconvolution is to generate the source environment cubemap and importance sample per pixel for a given number of samples using the full brdf. (This is mentioned in the Epic slides). An example of this importance sampling approach can be found in Substance Designer: http://www.allegorithmic.com/products/substance-painter It can also be found in the GPU Gems article: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html Marmoset also take this approach: http://www.marmoset.co/ However, I think their "skyshop" tool for Unity has pre-convolution functionality.
11. ## Proper C++ header file?

The only problem with it is that it is not part of the C/C++ standard, so while it is supported by major compilers, it can't be guaranteed to always work.       I thought that I should extend this a little. Compiler support for this is wide. http://en.wikipedia.org/wiki/Pragma_once   However, I'm yet to see someone screw up #ifndef INCLUDED_# (Aside from me, just then). .   Maybe I'm just being old and crotchety and indicating to people to get off of my lawn.  For me, I prefer #ifndef/#define. I prefer not to see "#pragma" in my code unless it is inline adding a library (which I prefer it wouldn't (still guilty of this myslef)), or disabling particularly annoying Microsoft compile warnings. I started with Visual Studio 5.0, and #pragma meant "hear be dragons" to me.   I think that preference on this may fit under "religious/other".   .

13. ## Tool release for physically based rendering

This is indeed fun stuff to work on.  The main driver for this release was to have an "end to end" example of the pipeline presented by Epic and Siggraph. I realize that this code may not be 100% correct. I'm somewhat hoping on community interaction to make the tool more relevant and further my own understanding.       Absolutely. This would be a good exercise for me in any case. There would be quite a lot to cover.  I have a number of other demos/projects in flight at the moment. I'll try to have something drafted by the new year.         This is something I can go into deeper in the future. For the moment, I have supplied CgFx viewport 2.0 shaders for Maya that use the LUT, and MDR cubemaps. They can be found in the maya directory in the IBLBaker root. There are also example scenes provided that demonstrate various use cases.         No problem! I'm hoping to do more of this sort of thing in the future for some other techniques:).         I'll start putting together some notes. . I'm also cleaning up the render API layer (It is based on my framework code from a long, long time ago) and adding support for GL 4.5 and OSX.
14. ## Tool release for physically based rendering

I've recently released an image based lighting baker for physically based rendering to generate preconvonvolved specular cube maps (computed against a user specified brdf) using the seperable method proposed by Epic during Siggraph 2013.   The tool also bakes out the BRDF LUT, and a diffuse irradiance environment map. Cubemaps are saved as both MDR and HDR.   You can find the tool at: https://github.com/derkreature/IBLBaker   There are also a number of walkthrough and example videos at: http://www.derkreature.com/ I have also supplied 2 Maya example scenes to test the cubemap outputs using Viewport 2.0 and cgfx. [media]https://vimeo.com/110805546[/media]   Please contact me through my github account if you find any bugs, have questions or have any suggestions. The code is based on some of my older framework code. You'll have to hold your nose around some of the more horrible bits.   Hopefully some of you find this useful. If there is any interest, I'd consider writing an article on this.   I thought I'd throw in another quick demo of this tech applied to character rendering. (Still proof of concept really): [media]https://vimeo.com/100285383[/media]
15. ## sensate

Kinect fusion style augmented reality: https://vimeo.com/83871057