Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Mar 2008
Offline Last Active Today, 03:47 PM

#5143499 Mapping problem onto a 2D quad

Posted by on 31 March 2014 - 09:34 AM

If you specify a R16 format, the Input Assembler expects 16 bit floats. You'd have to do a manual float32-to-half16 conversion.

#5141972 Hitbox setup

Posted by on 25 March 2014 - 05:51 AM

I see that whenever the boxes in the first picture align with the bones, their joints (spheres) in the rig-picture align as well.

The flat-laying boxes are the ones that seem to have axially aligned joints.

#5141679 Best way of volume selection

Posted by on 24 March 2014 - 05:16 AM

How about a two-click mechanism? The first click lets you drag a rectangle of blocks over the XZ-plane, the second click scales along the Y-axis. This allows the user to create any combination of blocks.

#5140298 Shadow Map problem

Posted by on 19 March 2014 - 06:00 AM

Are youe using a custom filtering kernel? seems to me you have a bug in the depth comparison method which causes results between neighbouring pixels in the map not to match up.

#5138891 Hitbox setup

Posted by on 14 March 2014 - 03:22 AM

Given the three orthogonal axes defined by a bone matrix, you could search for extreme vertices that are affected by the bone in the underlying mesh. If you search in both the positive and negative directions you'll end up with six planes that form an oriented box. This box you can then transform into world space using the same matrices as used for the bones.


Or you can transform the box by the inverse of its bone matrix if you need an AABB that's positioned at the origin. Would take up less memory.

#5138656 Visualising 2D Fluids (passing data to the GPU)

Posted by on 13 March 2014 - 05:10 AM

You simply cast the mapped resource to the same type as the view that describes it.


float* elementsOnline = (float*)mappedResource.pData;




memcpy(mappedResource.pData, elements, sizeof(float) * elementsCount);

#5138421 Visualising 2D Fluids (passing data to the GPU)

Posted by on 12 March 2014 - 09:14 AM

What rendering API do you use?


In D3D you can read floats from a Texture Buffer Object defined as: Buffer<float> aBuffer;

#5138373 Visualising 2D Fluids (passing data to the GPU)

Posted by on 12 March 2014 - 05:16 AM

You get a very obvious transition between spaces in and outside the volume, but perhaps you could do some post-process blurring and distortion like they do with volumetric cloud rendering.

#5138337 Displacement of vertex height from a grey scale texture on CPU

Posted by on 12 March 2014 - 01:12 AM

A typical displacement map is sampled like any other texture: using a set of texture coordinates (like from a uv map). You can use adaptive tessellation to create additional vertices that sample this map in between the original vertices.


If you want to do a one-on-one mapping of 409 displacement values tied to 409 vertices it makes more sense to store them as a vertex-(weight-)-map and use them as a vertex shader input (next to position, uvs, etc.).

#5138097 Curve to Polygon

Posted by on 11 March 2014 - 07:49 AM

Use the tangent of the curve at every keypoint transformed into screen space to determine in which direction you should offset vertices to create thick lines.


e.g. using the 2D "cross product": float2 posOffsets[] = { pos + float2(tan.y, -tan.x) * thickness, pos - float2(tan.y, -tan.x) * thickness };


If the end- and begin-points of two consecutive segments share the same calculations the quads should connect without gaps.

#5136542 Stack overflow help needed

Posted by on 05 March 2014 - 10:00 AM

How deep is this ownership hierarchy? Perhaps the function isn't optimized for tail recursion and you overflow the stack.


Not sure exactly what you're trying to do, but you could probably rewrite it without using recursion:

Object* root = this;

while(root->OwnerObj) root = root->OwnerObj;


#5129322 Power of normal mapping and texture formats?

Posted by on 06 February 2014 - 09:23 AM

Could I for example save alpha in normal map textures in the 'Z' channel, which is always sort of the same?


It's not always the same, but its value can be derived of the other two components.


D3D10 added the BC5_SNORM 2-channel format which lets you store the x and y channels in the normalized [-1, 1] range. The z component can then be re-calculated in-shader. This format provides high quality compression for normal maps.

#5129309 Baking a Local Thickness Map

Posted by on 06 February 2014 - 08:22 AM

Tried this out in Modo. Simply flip the polygons and bake an AO map.



#5128019 fbx tree with billboard leafs, but leaf quads are already made

Posted by on 01 February 2014 - 02:31 PM

If the quads are pre-oriented, you'll need to find a way to undo this transformation.


- Perhaps the orientation is stored within the mesh. Likely not, but maybe the author of the tool thought it might be useful for deformations (wind etc.).

- If the quads are uv mapped you can use that map, plus the directions of two edges on the quad to re-construct the quad's orientation (similar to what you do when normal mapping).


The quad's vertices multiplied by the inverse of the transformation (matrix) will give you the original quad. This you can then transform as a regular billboard.


Or simpler, you can take the average of the four vertices of the quad, the distance from this centroid position to one of the vertices and build a new quad.

#5125596 Some artwork associated with NATURE HATER

Posted by on 22 January 2014 - 02:48 AM

Looks like you got some talented people on your team.


I don't think I can pretend to be offended by video game violence any more tongue.png, but I do feel you could come up with a a bit more inspired/subtle title for the game.