• 11
• 9
• 10
• 9
• 10
• ### Similar Content

• By lxjk
Hi guys,
There are many ways to do light culling in tile-based shading. I've been playing with this idea for a while, and just want to throw it out there.
Because tile frustums are general small compared to light radius, I tried using cone test to reduce false positives introduced by commonly used sphere-frustum test.
On top of that, I use distance to camera rather than depth for near/far test (aka. sliced by spheres).
This method can be naturally extended to clustered light culling as well.
The following image shows the general ideas

Performance-wise I get around 15% improvement over sphere-frustum test. You can also see how a single light performs as the following: from left to right (1) standard rendering of a point light; then tiles passed the test of (2) sphere-frustum test; (3) cone test; (4) spherical-sliced cone test

I put the details in my blog post (https://lxjk.github.io/2018/03/25/Improve-Tile-based-Light-Culling-with-Spherical-sliced-Cone.html), GLSL source code included!

Eric

• Good evening everyone!

I was wondering if there is something equivalent of  GL_NV_blend_equation_advanced for AMD?
Basically I'm trying to find more compatible version of it.

Thank you!

• Hello guys,

How do I know? Why does wavefront not show for me?
I already checked I have non errors yet.

And my download (mega.nz) should it is original but I tried no success...
- Add blend source and png file here I have tried tried,.....

PS: Why is our community not active? I wait very longer. Stop to lie me!
Thanks !

• I wasn't sure if this would be the right place for a topic like this so sorry if it isn't.
I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link them all together. The issue I'm having with now though is basically the planets and moons orbit correctly at their own orbit speeds.
I'm not really experienced with using matrices for stuff like this so It's likely why I can't figure out how exactly to get it working. This is where I'm applying the transformation matrices, as well as pushing and popping them. This is within the Render function that every planet including the sun and moons will have and run.
if (tag != "Sun") { glRotatef(orbitAngle, orbitRotation.X, orbitRotation.Y, orbitRotation.Z); } glPushMatrix(); glTranslatef(position.X, position.Y, position.Z); glRotatef(rotationAngle, rotation.X, rotation.Y, rotation.Z); glScalef(scale.X, scale.Y, scale.Z); glDrawElements(GL_TRIANGLES, mesh->indiceCount, GL_UNSIGNED_SHORT, mesh->indices); if (tag != "Sun") { glPopMatrix(); } The "If(tag != "Sun")" parts are my attempts are getting the planets to orbit correctly though it likely isn't the way I'm meant to be doing it. So I was wondering if someone would be able to help me? As I really don't have an idea on what I would do to get it working. Using the if statement is truthfully the closest I've got to it working but there are still weird effects like the planets orbiting faster then they should depending on the number of planets actually be updated/rendered.

• Hello everyone,
I have problem with texture

# OpenGL Making the upper left corner position 0,0 and the bootm left on pos width,height?

This topic is 3672 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi I want to use OpenGL for some 2d drawing because of it's speed and features. I'm trying to set up the scene so when I draw a line from pos 0,0, to width,height it will actualy draw one on the screen at the same positions as well. If I don't set any perspective i get the 0,0 position on the center of the screen and but scaled down and If I use orthographic or perspective I won't see anything at all. Some source code:
        glViewport(0, 0, width, height); // reset the viewport to new dimensions
glMatrixMode(GL_PROJECTION); // set projection matrix current matrix
// calculate aspect ratio of window
gluPerspective(52.0f,(GLfloat)width/(GLfloat)height,1.0f,1000.0f);
glMatrixMode(GL_MODELVIEW); // set modelview matrix
this->SWidth = width;
this->SHeight = height;
return true;

and for the drawing:
        glPushMatrix();
glBegin(GL_LINES);
glVertex2f(x1,y1);
glVertex2f(x2,y2);
glEnd();
glPopMatrix();


##### Share on other sites
Look into gluOrtho2D (it's nearly equivalent to glOrtho2D, btw).

Replace your gluPerspective call with something like this:

gluOrtho2D(0.0, resolution_x_width, resolution_y_height, 0.0);

Note that the 3rd parameter resolution_y corresponds to GLdouble bottom, and the 4th param 0 corresponds to GLdouble top.

That should give let you specify vertices in pixels, where (0.5, 0.5) is the center of the upper-left pixel, and (639.5, 479.5) is the lower-right pixel center (assuming a resolution of 640x480).

Edit: Reason I said (0.5, 0.5) instead of (0, 0) is... For lines, points, and other geometry that has no 'volume' (or rather it is 0), you usually want to specify pixel centers, otherwise it's up to the OpenGL implmenentation to decide between the neighbouring pixels. But for geometry with volume, like triangles, quads, etc. you want to specify pixel corners, so a quad from (0,0) to (5,5) is a 5 by 5 pixel quad. This is all assuming you used the gluOrtho2D function to setup your GL_PROJECTION matrix, of course. Just wanted to give you a heads-up if you are interested in perfect (sub-)pixel precision.