Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Mar 2008
Offline Last Active Yesterday, 05:43 AM

#5260288 Texture bleeding/tearing with UV texture atlas mapping

Posted by eppo on 03 November 2015 - 05:33 AM

This is usually solved by making texels around uv-borders extend/bleed over said edges - enough to make sure there are never any outer 'undefined' texel values involved in a filtering operation.


- If you're baking this texture, modelling apps often have an option to 'expand uv-borders'.

- If your texture comes with an alpha map, one quick trick is to place a slightly blurred duplicate of the texture underneath the image. Or write a script that for any texel with a zero-alpha value duplicates the RGB value of the nearest texel with a non-zero alpha value.

#5245433 Tinted bloom?

Posted by eppo on 10 August 2015 - 06:06 AM

The issue is, I'm not terribly sure where to put the disc center. All I got is a light direction for the "sun", not a position. All of this ties in with something else I have yet to implement, rendering the glowy sun disc, so no idea how to do that.


If any ray parallel to the light direction hits the sun in its exact center, regardless of where it originated or its length, then you'll have to define the size of the disc as a minimum of the dot product of the ray and the light-dir. e.g.: if(-dot(ray, light) > 0.98) hitsDisc();


Two of these discs slightly apart (that is, have near perpendicular light directions), one reddish/yellow the other a blue tint, added together should give white light in in their overlapping areas.

#5245080 Tinted bloom?

Posted by eppo on 08 August 2015 - 06:53 AM

I'm not sure it's bloom/lens related. It seems the light has already been shifted somehow before it's reflected on the water surface and reaches the camera - that's why it looks upside-down. 


I would reflect the ray from the camera to the surface back to the light source, then colorize it based on where it hits the light disc.


Excess light is then blurred/redistributed afterwards.

#5229879 Triangulation

Posted by eppo on 19 May 2015 - 12:34 PM

Any movement of vertices may cause connected triangles to flip around, so you'll have to check for that. Also it may no longer be the most optimal triangulation (slivers etc.).

#5225125 Collision Detection and Camera movement. C#/Monogame

Posted by eppo on 23 April 2015 - 02:46 PM

1. Store an array of structs/classes instead of an array of integers. Every struct can contain a series of variables, including the index to the sprite, but also other properties like a boolean that tells a cell's collision condition.


2. Create a virtual camera. In this case that can simply be a pair of x, y coordinates. When you draw the playing field from bottom to top, you add these coordinates to an array indexing offset.


e.g.: for(y = 0; y < 25; ++y) for(x = 0; x < 25; ++x) cells[x + camera.x][y + camera.y].drawAt(x, y);


When moving the mouse cursor over the edge of the playing field, you can slowly increase/decrease the camera's .xy values.

#5203080 Cutting polygons by a grid.

Posted by eppo on 09 January 2015 - 07:25 AM

Simplest alternative to clipping would be to generate a triangulated volume of the boundary (if you don't already have a volumetric representation) using something like poly2tri. Then subdivide the mesh until all its edge lengths are below a certain threshold (to prevent too much distortion when you map its vertices to a sphere). If the map itself is triangulated you don't have to draw the sphere underneath it, avoiding possible intersection/z-fighting issues.

#5154069 How to draw [these kind of] splines?

Posted by eppo on 16 May 2014 - 12:01 PM

I suspect you'll be able to draw such a spline as a Hermite curve using only an outgoing and an incoming set of positions and (flat/horizontal) tangents.


You can use the Hermite routines that come with the D3DX-library.




Or you can use the cubic equations mentioned there directly.

#5152704 High Speed Quadric Mesh Simplification without problems (Resolved)

Posted by eppo on 10 May 2014 - 11:23 AM

Based on what criteria do you prioritize one contraction over the other? I don't see you (re-)sorting the list of triangles.

#5152524 Aligning a path, along a another dynamically

Posted by eppo on 09 May 2014 - 07:47 AM

This is probably easiest when the underlying road structure is defined as a network of interconnected splines. That way the center of the road and its tangent/direction are exactly defined. Also, you can do distance tests between the (tessellated) curve and surrounding points to see whether such points lie on the road. Lastly, a user-defined route becomes a simple series of (spline-)key-points.

#5151122 Having trouble with my Vertex Element Class

Posted by eppo on 03 May 2014 - 02:54 AM

What are the VertexElements you feed it with? Do elements that share the same semantic-name have individually unique indices? A name + index pair defines a unique semantic.


It would be less error sensitive if you don't have to specify a semanticIndex, but calculate it based on the number of previous occurrences of the same name.

#5149175 D3DXMatrixLookAtLH vs Custom View Matrix

Posted by eppo on 24 April 2014 - 09:26 AM

So basically the cross product for LH matrix doesnt seem to follow right hand thumb rule but rather left hand convention?


Yup. m_vecLookAtPoint faces away from you, so cross(LookAt, Up) would point to the left.

#5143499 Mapping problem onto a 2D quad

Posted by eppo 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 eppo 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 eppo 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 eppo 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.