• Create Account

# DDoS

Member Since 09 May 2012
Offline Last Active Jan 21 2014 06:38 AM

### In Topic: Geometry shader backface culling

23 July 2013 - 03:35 PM

i'd suggest to transform the points first by the view*model matrix, then make dot product of the point (normalized) with the view direction, probably (0,0,-1)

```float k = dot(diff, vec3(-1.0f, 0.0f, 0.0f));
```

gives you: k = |diff| * cos(angle_between_vectors) so this is actually a projection and not the angle you want, to erase the impact from the length of diff normalize diff first.

### In Topic: how to pass variables among vertex, geometry and fragment shaders

21 June 2013 - 06:53 AM

Sponji is right, vec4(normal, 1.0f) actually translates your normales too, you could also pass the normal matrix as a 3x3 matrix into the shader

### In Topic: glGetError() INVALID_OPERATION (1282)

22 February 2013 - 06:27 AM

most likely you forget to bind some necessary data to the current shader, pls post your code

render for debugging with glPolygonmode in wireframe, helps alot

(and dont use black as background color ;D )

### In Topic: Sobel edge detector

20 February 2013 - 08:27 AM

Thanks for your reply. I know how to make it work for horizontal, vertical and diagonal edges. Could you please add some more details for

an edge which is not either of these types?

you have to combine vertical and horizontal detectors:

http://en.wikipedia.org/wiki/Sobel_operator

use Gx and Gy as described to compute vertical and horizontal gradients

then combine those to the gradient G= sqrt(Gx² + Gy²) or a approximated gradient G= |Gx|+|Gy| (much faster)

### In Topic: Importing Pieces into OpenGL

19 February 2013 - 04:57 PM

you could use assimp supports alot of 3d formats
http://assimp.sourceforge.net/main_features_formats.html

as a beginner i'd recommend using non interleaved buffers, because you can get into troubles with offsets

those are my achievements from the last 2 weeks with learning opengl

PARTNERS