• Create Account

# apatriarca

Member Since 03 Jul 2006
Offline Last Active Today, 12:38 PM

### In Topic: Icosphere and height map

15 September 2016 - 04:37 AM

In the shader you can do many different things to improve the details:

1. Increase the tessellation dynamically using the tessellation shader,

2. Use displacement mapping to give the impression of details without actually adding more geometry.

### In Topic: Icosphere and height map

14 September 2016 - 04:32 AM

A few observations:

1. Do you really need to compute the radius each time? Isn't it a known quantity?

2. Why are you converting every angle to degrees? That's useless and you then have to convert them back to radians (or other range) to be able to use them.

3. The normal of each vertex is the vertex itself normalized. You can thus simply multiply the vector by some value to get the displaced one. If the vector has lenght R and you want its height to be H, you simply have to multiply by H/R.

4. This is probably all best done in a shader. The base displacement can be done in a vertex shader and you can probably also use a tessellation shader to increase details when needed. Finally lighting can do a great work in adding details.

5. I still have to check the correctness of your formulas.

### In Topic: fast sin approx algo not faster than sin() ?

07 September 2016 - 12:47 PM

My problem with volatile was its use inside the loop. In this case the compiler can't rely on the fact the variable has not changed between the various iterations and it has to load&store each time the variable is used. An alternative solution, I think, can be to write to a big array.

### In Topic: fast sin approx algo not faster than sin() ?

07 September 2016 - 04:00 AM

The volatile keyword basically prevents any optimization in the loop. Moreover, each loop iteration depends on the previous one which means low pipeline usage in the CPUs and no chance for SIMD auto-vectorization. This isn't a particularly meaningful benchmark and I think it is not representative of the real performances of these functions.

I would simply use sin or sinf. In most cases it should use the correct cpu instruction, eventually also using SIMD ones or treating them as constant expressions.

### In Topic: Linux: Coding a video player for a game?

02 September 2016 - 01:22 PM

What video player library you are using on the other platforms?

PARTNERS