I'm using hardware shadow mapping on JOGL based on the demo(HardwareShadowMapping) supplied by the distribution. After generating the shadow texture from lights point of view, I apply it to my scene with no problems.

What I'm looking for is soft shadows instead of pitch black shadows. Is there any way that I can change the alpha values while applying the shadow/depth texture? Btw I'm not an expert on OpenGL especially about custom shaders and I don't want to spend more time on understanding and developing custom shaders instead of the game.

Here's a screenshot of the application in case you come up with another solution to what I'm trying to achieve. The game is actually a hack&slash RTS hybrid.Here's the pseudo code of the gl event listener attached to shadow pbuffer.

  gl.glPolygonOffset(polygonOffsetFactor, polygonOffsetUnits);
  //render shadow casting geometry
  gl.glBindTexture(GL.GL_TEXTURE_2D, lightViewTextureID);
  gl.glCopyTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
  //I sense here a way of updating alpha values of this texture

Engine Application Sample

  • \$\begingroup\$ Hi, still need help? \$\endgroup\$ – elect Aug 13 '15 at 11:59
  • \$\begingroup\$ Not particularly after this long but an answer would be good for others looking for help \$\endgroup\$ – Gorky Aug 14 '15 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.