• 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 How can I use DirectX write depth buffer to 1 with certain stencil test pass area

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

## Recommended Posts

I am doing 3D rendering the recursive reflections between multiple mirrors. But before that, drawing only one mirror's reflection has a problem with depth buffer handling:

Here is the steps:

Drawing the whole scene objects except the mirror. The problem maker is the floor. The mirror is in the middle of the floor, which means there is a part of the floor behind the mirror. So when drawing the mirror's reflection, there is already drawn floor behind the mirror. When I draw the reflections, some part of the floor is not covered by the later drawn reflections due to less Z value(they should have the same Z value but the imprecisely calculation floating point Z may give the wrong number). So I have to clear the depth value in the reflection part. To be precisely, only clear the non-occluded mirror part depth value to 1. It is easy to do this with stencil buffer. In OpenGL, it is easy to do this:

gLColorMask(0,0,0,0);

gLDepthRange(1,1);

gLDepthFunc(GL_ALWAYS);

gLStencilFunc(GL_EQUAL, 1, ~0);

glStencilOp(GL_KEEP, GL_KEEP,GL_KEEP);

drawreflections();


then draw only the non-occluded mirror into depth buffer with value 1.

But In DirectX11, I found no way to only draw into depth buffer with specified depth value when self defined stencil test passed. Is there? (I hope I just missed it)

So I walked around this: first use stencil to record the non-occluded mirror part with stencil value 1. Then clear the whole depth buffer to the highest value--1. Then draw the reflections only pass the stencil test. And finally draw the mirror also according the stencil test. Since the stencil test keep the original depth order between the already drawn objects and mirror. Even the depth information lost after I clear the whole screen depth buffer, the stencil buffer keep the sort of depth information: all the stencil value = 1 means non-occluded mirror part, so the occluded part will not be drawn.

So in this walk around way, it works fine. Even with 2+ mirrors without reflecting the reflections, it works well. But when I approach to the 2+ mirrors recursive reflections, the clear whole depth buffer method does not work. In this way, I have to create a new depth buffer in every new level of the recursion to save old depth values. Only one depth buffer does not work this way.

Do you guys know about set depth value to specific area according to stencil test in DX11?

What do you do when render the unconstrained reflection?

According to NVIDIA's Mark J. Kilgard's 15+ years ago's article(Improving Shadows and reflections via the stencil buffer), he drew the mirror first that is because he can use openGL clear the partial depth buffer as 1 according to the stencil record. I have to draw all objects first except the current mirror, then use stencil to record the mirror and depth relations. But use this method to do recursion, the entire depth information will be cleared from previous level, so it does not work unless you create a new depth/stencil buffer in each recursion level.

?