Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - madmadmax

#1
Support / Re: blend framebuffers
July 24, 2007, 10:44:29 PM
I found the answer how the opacity level for object3d can be controlled: One has to tweak Config.glTransparencyOffset and Config.glTransparencyMul (for opengl renderer).
Once again, thanks for the great support!
#2
Support / Re: blend framebuffers
July 24, 2007, 10:35:08 PM
Of course! Thanks for pointing out my stupidity  :P

Here's an image of what I want:
[img=http://img464.imageshack.us/img464/2789/unbenannt1jh5.gif]

This could be achieved by drawing the red object transparent over the white object. However I'm not really sure how to draw a transparent Object3D. If I use setTransparent with a value of 0, the object gets transparent, but not as much as I desire. Transparency also is only possible in about 5 steps (from 0-5) Is it because my 3ds object is created in the wrong way? Is there a thread that describes how such transparent objects are made for the jpct 3ds loader?
Thanks for the awesome support of yours, Egon!
#3
Support / Re: blend framebuffers
July 24, 2007, 08:46:58 PM
Egon, thanks for your quick reply!
I just thought of a better way to achieve the same effect as described in my previous post. If the world is rendered twice into same framebuffer, whereby the depth buffer is cleared in between, it should be the same (If the world is set transparent the second time). In a first step I tried without transparency. The below code snippet shows this, the world is drawn the second time a bit rotated to see the effect. I would assume that the world drawn in red (because of glColorMask) would win in the Z-Buffer, because it is drawn after the world drawn in white, however it gets blended over the white rectangle (As can be seen in the image).


      buffer.clear();     

      GL11.glColorMask(true,true,true,false);
     
      world.renderScene(buffer);
      world.draw(buffer);
      buffer.update();
           
      buffer.clearZBufferOnly();
 
      camera.rotateY(-rot);
     
      GL11.glColorMask(true,false,false,false);
     
      world.renderScene(buffer);
      world.draw(buffer);
      buffer.update();
           
      camera.rotateY(rot);
     
      GL11.glColorMask(true,true,true,false);
      buffer.displayGLOnly();


The image:
[img=http://img523.imageshack.us/img523/7402/effectmr2.th.jpg]

Thanks for any suggestions!

#4
Support / blend framebuffers
July 24, 2007, 06:57:07 PM
Hello,

I want to do the following:
1. draw a scene into a framebuffer f1
2. draw the scene a second time into another framebuffer f2 with a different glColorMask, so that only the red color parts are drawn
3. blend f2 over f1, so that f1 shines through f2
Is this possible? Point 1. and 2. are easy, however I'm not sure how to do 3  ???

Thanks in advance,
mmm

PS: Happy Birthday  ;)