Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Jun 2012
Offline Last Active Jul 16 2012 07:17 AM

Posts I've Made

In Topic: [Dx8] Texture & Blending

29 June 2012 - 10:15 AM

I see, it's simple when it's explained like this Posted Image
In fact, I thought the utilisation of D3DTA_ALPHAREPLICATE didn't allow me to use vertex color but rather SRCBLEND=D3DBLEND_ONE. If (for example) I want to change only the alpha of the texture, can I use a another method that modulate the AlphaOp ?

[source lang="vb"] D3DDevice8.SetRenderState D3DRS_TEXTUREFACTOR, D3DColorRGBA(255, 255, 255, 100) ' Alpha = 100 for example. D3DDevice8.SetTextureStageState 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 D3DDevice8.SetTextureStageState 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE Or D3DTA_TFACTOR D3DDevice8.SetTextureStageState 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT[/source]

But the operation seem to work with the black transparent texture.

Edit : Finally I'll see it later, this is not essential for my project, my biggest problem is already solved and I thank you again for that.

In Topic: [Dx8] Texture & Blending

29 June 2012 - 05:31 AM

I don't understand why I used D3DRS_DESTBLEND=D3DBLEND_ONE to rendering the texture and I don't tried D3DRS_SRCBLEND=D3DBLEND_ONE.. It's so obvious now that I look stupid Posted Image

Thank you very much for all your help, I'd probably still to find the problem. I haven't yet understood all the logics of blending color for the moment but it will come, I already understood the logic that you tried to explain me Posted Image

If that doesn't bother you I keep your code in C++, I think this is a good example for me when I will turn to this language.

However, I have a last question because it's the only thing I didn't quite understand. The D3DTA_ALPHAREPLICATE doesn't allow to use vertex color because he take the informations only in the texture ?

In Topic: [Dx8] Texture & Blending

28 June 2012 - 04:59 AM

Sure, and finally the problem with blending of two colors isn't resolved. I add a new circles to show the problem when a rendering the texture with :

In fact, there is perhaps only one problem and he isn't necessarely to rendering the texture with D3DBLEND_ONE in destblend.

I updated the sources in the original link, or download here the edited sources.

In Topic: [Dx8] Texture & Blending

26 June 2012 - 04:00 PM

Hi and sorry for my absence (I had some problems with my pc).

This blending stage seem to work with the RGB blending, but the Alpha stay problematic. See here.
There are two problems, the alpha is too low and the blending of two color is incorrect when one of two isn't opaque (In fact, in the situation the opaque color became transparent).

I understood what you want to do but I'm not sure that the stage 1 is useful here (The ColorOp in the stage 1 is disable by default, so in this situation is ineffective, no ?).

Edit : The problem with blending of two colors has been resolved, there remains the problem of alpha too low.. See here.

In Topic: [Dx8] Texture & Blending

24 June 2012 - 12:50 PM

Yes, I know it's possible, but I don't understand exactly how Shilbert told me to do that. Use the same texture in 2 stages to separate opaque pixel and transparent pixel (with a different blending operation for each) or 2 textures in 2 stages for blending between them ?