Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Apr 2013
Offline Last Active Sep 08 2015 11:41 AM

Topics I've Started

Give me your Java and Python code

28 February 2015 - 04:16 AM


at the moment I'm heavily procrastinating, so I thought it's a good
time to refresh my language knowledge smile.png

Therefore, I'm asking if one of guys has a small game (around 10k loc maybe)
written in Java or Python that I can tinker around with.
Ideally, the game has only a few library dependencies. Also, the code should
be "java-ish" or "python-ish" (as opposed to translated from, say, C), so I get
to learn common idioms and standard libraries.
Open source games are fine, too.

So, any suggestions? smile.png

Orthographic projection causes artifacts

06 September 2014 - 09:24 AM

Hey guys,


I observe strange artifacts in my application when I switch from perspective projection

to orthographic projection.

Here's an image of the problem: https://dl.dropboxusercontent.com/u/56764397/projection_bug.png

It looks to me like some sort of z-fighting.


Now, I'm using depth peeling for transparency and the artifacts

disappear when rendering with another transparency technique,

so maybe the issue is how I read and write the depth textures.


It's pretty strange, though, because the projection matrix is not referenced in any fragment shaders.


Any ideas what I can do to isolate the problem?



Stencil Buffer Artifacts

08 November 2013 - 10:30 AM

Hi everyone,


I'm using the stencil buffer to draw the intersection of a plane and a sphere. However I'm getting some annoying artifacts near

the boundary of the intersection. See the attached image.

These artifacts depend on the camera position. And although they look somewhat polygonal they generally don't coincide with

the edges of either mesh.


Any ideas?


Here's the algorithm I'm using:


Depth test is enabled, culling is disabled.


- Draw the plane mesh with stencil.func.ref = 1 and stencil.func = GL_REPLACE.

(ie. fill the stencil buffer with 1)


- Draw the sphere with depth.mask = false and

stencil.op.zpass = GL_INCR for front faces and stencil.op.zpass = GL_DECR_WRAP for backfaces

(I use glStencipOpSeparate and draw the sphere once)


- Blend fullscreen quad where stencil value is greater than 1

Artifacts on Intel HD Hardware

19 May 2013 - 02:53 PM

Hi everyone!


I'm experiencing strange rendering artifacts when running my program on Intel graphics hardware. According

to Google that's not unusual, so I'm hoping you guys have some advice for me smile.png


See the attached image. I have a NVIDIA Optimus laptop setup. On the right side you see the output

of the dedicated NVIDIA GPU, which i consider to be correct. On the left side you see the output of the

Intel HD 3000 onboard GPU, using the most recent drivers, showing some kind of white stripes, which

flimmer when moving the object or the camera. I think this looks like z-fighting.


I'm doing pretty basic multiple pass lighting, with this setup:

Pass No.  DepthMask DepthFunc

0              TRUE          LESS

1              FALSE        EQUAL

>1            FALSE        EQUAL

The problem does not show up if I render only one pass.


I tried to eliminate the most likely reasons for z-fighting:

On both GPUs the depth buffer is 24bit in size. (checked using glGet*(GL_DEPTH_BITS)

and QGLFormat::depthBufferSize())

In my projection matrix, I set [zNear, zFar] to reasonable values, eg. [0.1, 100], [1, 40].

Playing around with glPolygonOffset didn't solve the problem.


The white stripes are still visible, when I draw the mesh in solid black, by setting the lighting

color to black.

When I disable blending, the stripes become black and the problem remains the same.


So basically, I have no idea what to do smile.png Do you guys have any advice or idea

what might be the problem?