Jump to content
  • Advertisement

testt

Member
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

115 Neutral

About testt

  • Rank
    Newbie
  1. testt

    [Dx8] Texture & Blending

    I see, it's simple when it's explained like this 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 ? I thought to use D3DTA_TFACTOR (or D3DTOP_BLENDFACTORALPHA) with D3DRS_TEXTUREFACTOR like this : [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.
  2. testt

    [Dx8] Texture & Blending

    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 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 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 ?
  3. testt

    [Dx8] Texture & Blending

    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 : D3DRS_DESTBLEND=D3DBLEND_ONE 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.
  4. testt

    [Dx8] Texture & Blending

    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.
  5. testt

    [Dx8] Texture & Blending

    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 ?
  6. testt

    [Dx8] Texture & Blending

    I see, but when you add second color stage, you use a different texture (example : stage0 for 1.png and stage1 for 2.png) or is the same texture ? I don't want to modify the texture because I'll use several times (many textures and sometimes the same texture), I think it's problematic and longer to load after. It's even why I create a texture to preload all once. Also, I already found the guy who propose a librarie for dx9 in vb6, but it's incomplete (For example, I use CreateTextureFromFileInMemoryEx and he isn't added). If I don't found solution for this, I migrate probably to vb.net (It's my last solution).
  7. testt

    [Dx8] Texture & Blending

    Yes, I thought to use D3DRS_SEPARATEALPHABLENDENABLE but D3D8 don't support this. I've searched a alternative to this but I don't find solution.
  8. Hi all, (and sorry if my english is bad). I develop a game in Vb6 with directx8, now I'm stuck on a problem and I don't know if it's correctable. To explain my problem, I create textures in format A8R8G8B8 (32bits) and filled this with preloaded textures (png). The problem is that the generated texture doesn't display a correct rendering. For example, if I draw something with transparent pixels, DirectX blending what I draw with the background color (transparent black) and so the texture rendered is darker than it should be. I can't desactivate alphablending. So I tried different operation of blending (also srcblend and destblend) and I haven't found solutions.. You can download here the source who reproduce my problem and see here an image of the problem. Thank for any help. Edit : You can see here exactly le same problem, but he hasn't found a real solution.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!