Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

576 Good

About sensate

  • Rank

Personal Information

  1. sensate

    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. 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. 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. 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:
  5. sensate

    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:   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. 
  6. If you are looking for just a baker, this guy is doing some amazing work:
  7.   Yeah, I should probably overhaul the home site and the description to better communicate this. Thanks for pointing this out!
  8.   I would suggest reading the Epic slides and course notes for a more detailed overview:   And for some pretty pictures:   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   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][/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: It can also be found in the GPU Gems article: Marmoset also take this approach: However, I think their "skyshop" tool for Unity has pre-convolution functionality.
  9. sensate

    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.   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".   .
  10. sensate

    Proper C++ header file?

    Some general thoughts and ramblings. Ramblings are inlined in comments. :). #ifndef INCLUDED_TILEMAP_H #define INCLUDED_TILEMAP_H // You are only using string. // You should only include string. // Judiciously including only what you use will improve compile times. // This is so important that people have written tools to ensure that a // code base adheres to this: // // #include <string> // Style guides, totally worth reading up on. // Seeing as you are just starting out, choose a different one for every project. // Adhere to it. Learn what you don't like about it: // // // // Many more by googling "c++ style guide" + some company name. class TileMap { public: // Declare the default constructor. Even though a default is provided, it is // a really, really good habit to get into. // TileMap(); // Declare the copy constructor. It will save you later. // I would also (maybe) suggest looking into the concept of "non copyable". // TileMap(const TileMap& from); TileMap(const std::string& name, const std::string& location); // Declare the default destructor. Even though a default is provided, it is a // life saving habit to get into. // ~TileMap(); // Again, one is provided, but quite honestly, this is a another life saving habit // to get into when you are just starting out. // TileMap& operator=(const TileMap &); // Const references for input when setting a value. // void setName(const std::string& inName); // I assume that "loc" is location. // A longer variable name will help you later when you have other stuff to think about. // void setLocation(const std::string& inLocation); // Accessors usually are const. I tend to loathe using get on the "gettor". // Returning a const ref here is also faster. // I also suggest reading up on return value optimization... // // If you are aiming for well performing code I would recommend doing away with // the use of std::string all together and using const char*. // Supplying a const char* in the "create" function should also lead you onto // topics such as "copy on write", which is something totally worth reading about: // (But not until you know why you shouldn't have a function // operator in a class declaration :) ). // // Now I'm rambling, so I will stop. // const std::string& name() const; const std::string& location() const; private: // You should probably consider marking your members with a character // that indicates the variable is a member. // Some naming models become very elaborate at the expense of readability. // I prefer underscores, others prefer m, some specs prefer extended information // for pointers. I.e., if _name were a pointer, the variable would be _pName or mpName. // std::string _name; // or mName std::string _loc; // or mLoc }; #endif
  11.   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.
  12. 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:   There are also a number of walkthrough and example videos at: I have also supplied 2 Maya example scenes to test the cubemap outputs using Viewport 2.0 and cgfx. [media][/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][/media]
  13. Kinect fusion style augmented reality:
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!