• Create Account

We're offering banner ads on our site from just \$5!

# xlope01

Member Since 18 Jun 2013
Offline Last Active Sep 28 2014 09:08 AM

### Why discard pixel take a noticeable performance hit?

16 April 2014 - 11:02 AM

something as simple as that

```if(textureColor.a < 0.5f)
```

take around 25% hit in frame rate (assuming all the objects on your scene use that)

### Smooth normals

09 November 2013 - 09:47 AM

How do you smooth normals?

### Picking triangle

10 September 2013 - 12:26 PM

Based on this tutorial I have try to make it work with triangles with no success.

this tutorial is demonstrating how to how to do picking on the a sphere, so in theory if i take the rayOrigin and rayDirection can work with a  triangle.(without the MatrixTranslation for the center of the sphere), but don't because something needs to be changed regarding the rayOrigin / rayDirection.

all i want is to get the intersection point on the triangle.

```struct triangle {
D3DXVECTOR3 V0;
D3DXVECTOR3 V1;
D3DXVECTOR3 V2;
};
struct Ray {
D3DXVECTOR3 P0;
D3DXVECTOR3 P1;
};
...
intersect3D_RayTriangle(Ray, triangle, out intersection point);//this method works fine, if you don't put the ray data that comes from this tutorial
```

31 August 2013 - 07:21 AM

How I can save to a file a ID3D11ShaderResourceView and also with the same format (DXGI_FORMAT_R16G16B16A16_FLOAT) ?

### Percentage Closer Filtering

09 August 2013 - 05:09 PM

I'm trying to create PCF from my Shadows but when I perform PCF filtering I get always 0.0

```SamplerComparisonState cmpSampler
{
// sampler state
Filter = COMPARISON_MIN_MAG_MIP_LINEAR;

// sampler comparison state
ComparisonFunc = LESS_EQUAL;
};

..............

float2 texOffset( int u, int v )
{
return float2( u * 1.0f/2048.0f, v * 1.0f/2048.0f );
}

...............

float sum = 0;
float x, y;
//perform PCF filtering on a 4 x 4 texel neighborhood
for (y = -1.5; y <= 1.5; y += 1.0)
{
for (x = -1.5; x <= 1.5; x += 1.0)
{
sum += localShadowTextures[1].SampleCmpLevelZero( cmpSampler, input.localLightViewPosition.xy + texOffset(x,y), input.localLightViewPosition.z );
}
}
float shadowFactor = sum / 16; // <--- no matter what i always get a 0 here.

```

PARTNERS