sdw |
Posted - May 02 2004 : 5:07:55 PM How do I blend a color with a surface? I am using directdraw7/d3d7.
My idea was to make a second surface with the same dimensions, fill it with the color i want, then alphablend it over the original surface. Any quicker/easier ways to do this? |
sdw |
Posted - Jul 06 2004 : 11:40:23 AM Nevermind, I guess it helps to enable the specular. |
sdw |
Posted - Jul 06 2004 : 10:54:16 AM quote: I'm sorry, my engine was designed in directx 8, and I used the specular to brighten the colors...
Ok, how do I do that then? |
sdw |
Posted - May 05 2004 : 8:12:27 PM there really isn't a lot of info about this on the net :\ |
EACam |
Posted - May 05 2004 : 3:48:54 PM ok...
now i have another thing to worry about.
i spose trial and error is the key. |
VBBR |
Posted - May 05 2004 : 1:07:24 PM ...since a Long is 4 bytes, then the bytes would be A R G B in this order, or R G B A, in this order.
It really depends on WHAT you are applying the color on. |
Eric Coleman |
Posted - May 05 2004 : 11:12:00 AM Actually, the byte order is different, and I think you need to make sure that the byte order of the colors you use is the same as the surface that you're using them on. |
EACam |
Posted - May 05 2004 : 10:59:36 AM Ok, so it doesn't matter which i use? If i have Color As Long then I can just say Color = D3DColorRGBA(R, G, B, A) or Color = D3DColorARGB(A, R, G, B) and both will work? Cool. |
VBBR |
Posted - May 05 2004 : 10:45:49 AM The position of the "A" .
Well, pratically it's, if the function comes in the order ARGB then you put it in the order, Alpha, Red, Green, Blue. If it's RGBA then you put it Red, Green, Blue, Alpha. Pretty obvious. |
EACam |
Posted - May 05 2004 : 08:38:54 AM Cool...I try it.
So what's the difference between RGBA and ARGB? |
Eric Coleman |
Posted - May 04 2004 : 7:49:22 PM ColorOp and AlphaOp determine how vertex color and texture colors are blended together. For example, if you set your colorOp to modulate, that effectively multiplies texture color time vertex color. If you have a grayscale texture, then you can adjust the output color by adjusting the vertex colors. If your texture is blue, RGB(0,0,1), and your vertex color is red, RGB(1,0,0), then the output would be black. 1*0, 0*0, 0*1. If the color is gray, RGB(.5, .5, .5) and a vertex color is green, (0,1,0), then the final color would be RGB( 0, .5, 0). There are also alpha operations, which allows you to use different effects for combining the alpha from a vertex color with the alpha in a texture.
Look at this screenshot, the red, green, and blue color variations are controlled by adjusting the color value of the vertices. The bottom row show variations in the Alpha component of the vertex colors. The smiley face is created from alpha values in the texture.
|
EACam |
Posted - May 04 2004 : 1:41:52 PM I'm not sure what you mean about ColorOp modulate ????
What's teh difference between ARGB and RGBA? Wich should I use? |
Almar |
Posted - May 04 2004 : 12:19:23 PM quote: Originally posted by EACam
Really? Cool. In my app tho, alpha one blending only works if I set alphaone to both the dest and the src. And then the alpha one is kind of constant. I can't set an amount of alpha one like i can for regular alpha. Is that normal?
Use ColorOp modulate and set the alpha component of the vertex color (D3DXColorARGB(128,255,255,255) or something)? Not sure if that's what you mean :) |
EACam |
Posted - May 03 2004 : 12:41:53 PM Really? Cool. In my app tho, alpha one blending only works if I set alphaone to both the dest and the src. And then the alpha one is kind of constant. I can't set an amount of alpha one like i can for regular alpha. Is that normal? |
Eric Coleman |
Posted - May 03 2004 : 10:40:14 AM Actually, you can achieve an additive blend with alpha blending. All you need to do is set the correct blend modes, SrcAlpha for the source and One for the destination. To increase colors, you would blend a non-black color over the target surface.
This color increase only increases color saturation, not luminosity. You can achieve the latter by using a gamma ramp, but that effects the entire image.
|
EACam |
Posted - May 03 2004 : 09:11:49 AM You cannot brighten with alpha...sorry. It isn't additive blending...i've tried. But the specular thing might work. How did you do that DaBooda? |
|
|