Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


FireInDark

Member Since 11 Jul 2012
Offline Last Active Private

Posts I've Made

In Topic: Freetype/GL/VBO/shaders

14 August 2012 - 09:28 PM

great job

In Topic: I need to copy datas from a buffer to texture object

12 August 2012 - 08:52 PM

If you only need information from your alpha channel, after your first render of A, then it might be sufficient to use some properly set up alpha blending. Try using the destination alpha to blend with in glBlendFunc.

If that is not sufficient, I see several other options. The problem is mainly that you cannot read from and write to the same FBO. Several workarounds:
- As you mentioned, copy the data to another texture and use this texture during the render of B. Not really fast imo.
- Use 2 FBO's. You use a separate renderpass where you render A's "alpha" as a greyvalue to the second FBO. Then you can use this data while rendering A and B to the first FBO.
- Use one FBO with two color targets. This works, is probably the fastest if simple blending is not sufficient, but is a bit difficult to set up properly.

Apart from these, I don't see a fast way to get what you want. However, I believe you should be able to achieve what you want using alpha blending.


Maybe I understand now ,let me have a try.

Thank you very much.

In Topic: I need to copy datas from a buffer to texture object

10 August 2012 - 03:44 AM

It is this:

There are two elemets A and B .
1.We render A to the Frame Buffer - yes then the Frame Buffer contains pixel of A , some pixels's alpha are zero and some are not..
2.We render B to the Frame Buffer - and how ever - if the alpha in Frame Buffer is zero ,the pixels at the same position(2D) of B will be draw to the FrameBuffer else not.

May be we can use stencil values but there are some reason I don't want to do like this.

Any way ?

In Topic: I need to copy datas from a buffer to texture object

10 August 2012 - 03:37 AM

What do you mean by visiting the data of the Frame Buffer? Do you wish to use the data on the CPU?


No I don't use the datas in CPU but GPU -GLSL

I need control if the right pixel of an element such as a triangle will be draw to the frame buffer.

In Topic: I need to copy datas from a buffer to texture object

09 August 2012 - 02:43 AM

Think about that :
If copy the datas to a texture with glCopyTexImage2D every time an element rendered ,wouldn't it'll take a long time?

PARTNERS