Well, I have generally used irrlicht for 2D stuff.
And one thing I´ve never tryed to implmente, was Tone, Opacity and Alpha Channel (all in one) in a texture
I mean:
Tone: add a kind of additive color, composed by : (Red, Green, Blue, Gray)
Opacity: total opacity of the texture (like using EMT_TRANSPARENT_VERTEX_ALPHA)
Alpha Chanel: use alpha chanel of the picture of the texture (EMT_TRANSPARENT_ALPHA_CHANNEL)
The thing is, I cannot convine that two materialKind in one, and tone is not available in any material ( EMT_LIGHTMAP_ADD is the most close, but it doesn´t provide Grey parameter)
So, I use the clasic method of accessing all pixels and "play with them".
This method works great, with a very big problem: lost of performance when I change Tone or opacity (I use material EMT_TRANSPARENT_ALPHA_CHANNEL for alpha channel) in an update, FPS goes down:
With 16 textures (128 * 196) it work at 10 FPS
I know it is because I´m using the CPU instead using the GPU, so the question is:
Is there any method to do this using GPU capabilities in irrlicht?
Thanks.
(Sorry for my English, I speak Spanish XD)
Tone, Opacity, and Alpha Channel
Tone, Opacity, and Alpha Channel
Last edited by Metalero on Fri Mar 18, 2011 1:22 am, edited 1 time in total.
-
- Posts: 363
- Joined: Thu Dec 16, 2010 8:50 pm
- Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..
um.... last time i checked opcacity means same thing as alpha...
and what do you mean by "tone"
you can have an SColor/ SColorf and pretty much make ANY color. there are a lot. 256^3 colors
uh... im not sure what you are asking:
do you mean like accesing low-level video driver?
i think you can choose low-level params like poly shape types and then you can "play with the pixels" with fragment shaders and vertex shaders...
and what do you mean by "tone"
you can have an SColor/ SColorf and pretty much make ANY color. there are a lot. 256^3 colors
uh... im not sure what you are asking:
do you mean like accesing low-level video driver?
i think you can choose low-level params like poly shape types and then you can "play with the pixels" with fragment shaders and vertex shaders...
Well, yes, alpha and opacity it´s the same, but wath I mean is:
Alpha chanel -> use alpha data from de image file
Opacity -> posibility of varying alpha by code, to make a texture (wich has alpha channel) more or less translucent
Tone, is the same as using EMT_LIGHTMAP_ADD meterial type, and vary the 2° texture color
Shortly, I want to mix EMT_LIGHTMAP_ADD, EMT_TRANSPARENT_VERTEX_ALPH and, EMT_TRANSPARENT_ALPHA_CHANNEL in the same material, without having to change pixel by pixel manually, wich is very low in big textures.
Alpha chanel -> use alpha data from de image file
Opacity -> posibility of varying alpha by code, to make a texture (wich has alpha channel) more or less translucent
Tone, is the same as using EMT_LIGHTMAP_ADD meterial type, and vary the 2° texture color
Shortly, I want to mix EMT_LIGHTMAP_ADD, EMT_TRANSPARENT_VERTEX_ALPH and, EMT_TRANSPARENT_ALPHA_CHANNEL in the same material, without having to change pixel by pixel manually, wich is very low in big textures.