• Create Account

# montify

Member Since 07 Nov 2012
Offline Last Active Aug 26 2016 05:44 PM

### In Topic: [XNA] Matrix.CreateRotationX

09 November 2015 - 12:39 AM

Thank you guys for answer, i hardcoded the Matrix.

But i have another issue.

My Planet is normalized Cube with six side.

I create the Noise Value like here described:

https://britonia.wordpress.com/2009/12/23/noise-part-iii-gpu/

The Noise generated for each patch, so the PixelShader needs the Coordinate of the patch (xNW, xNE, xSW).

For the root Patch ( without subedived the quadtree it´s):

```
nw = new Vector3(-1,0, 1);
ne = new Vector3(1, 0, 1);
sw = new Vector3(-1, 0, -1);
```

Assume this is for the TopSide of the Cube.

How i get the noise for the Front side of the Cube?

It´s a 3d noise Funtion in the Shader so how i can translate the nw, se, sw Vector to match the front side (when i pass the right Value i have no seams on the Cube Faces like:)

### In Topic: [XNA] Matrix.CreateRotationX

07 November 2015 - 09:12 AM

the thing is: is have 6 flat grids (33x33 Vertices) i would translate each grid to a Cube. Should the number not -1 or 1 ? Why is it so tiny?

10 October 2015 - 10:57 AM

Found the problem,

Horizon Culling is poor -> http://crappycoding.com/2009/03/horizon-culling/

Anbody knows a better Method?

### In Topic: Use 64bit precision (GPU)

21 April 2014 - 11:14 AM

Update:

Now i do the Relative to the Eye transformation in the VertexShader

```VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{

float3 worldPosition = mul(input.Position, World).xyz;

float3 normalized = normalize(worldPosition);  // Normalize all Vertex to get a Sphere

float4 scaled = float4(normalized * SeaLevel, 1);  // Scale all Vertex with SeaLevel = 6000

scaled -= float4(camPosition, 1); //All geometry relative to the Eye

output.Position = mul(scaled, ViewProj);
output.Position.z = log(C*output.Position.z + 1) / log(C*Far + 1) * output.Position.w; //Logarithmic Depth Buffer
return output;
}
```

It works, no Jittering, but i have some odd  "stairs"

So whats going on here?

### In Topic: Use 64bit precision (GPU)

19 April 2014 - 10:40 AM

So i have it .

I Set the Camera Posititon to Vector3.Zero and "hack" the worldMatrix

```  //new View Matrix
var View = Matrix.CreateLookAt(Vector3.Zero, cam.Forward, cam.Up);

Vector3 cameraSpacePosition = (position - cam.Position);

//Relative to the Camera
world.M41 = cameraSpacePosition.X;
world.M42 = cameraSpacePosition.Y;
world.M43 = cameraSpacePosition.Z;
```

But i scale/normalize each vertex (the entire Planet) in the Shader like ( with *6000):

```VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{

float3 worldPosition = mul(input.Position, World).xyz;

float3 normalized = normalize(worldPosition);
float4 scaled = float4(worldPosition * 6000, 1);

output.Position = mul(scaled, ViewProj);

output.Position.z = log(C*output.Position.z + 1) / log(C*Far + 1) * output.Position.w; //Logarithmic Depth Buffer

return output;
}
```

The Scale and Normalize don't work anymore...

anybody out there who have a Solution for this Problem?

PARTNERS