Instead of using rgb_scale, make the color blend effect with a Local
It would be nice to be able to blend the map's colors in rendering time by using a local variable, instead of using rgb_scale manually everytime I want to change it.
Instead of cloning a FPG in memory and then changing the color in every map of that cloned FPG with rgb_scale, we would use just one FPG in different "Process" with a different local variable (something like color_blend) and the rendering engine would change the color just at rendering time.
Ps: I don't know if I've explained myself enough, so Spanish here:
El objetivo sería tener un FPG en memoria y hacer ese cambio de color sólo en el momento de renderizar ese gráfico en base a una variable local.
Comments (5)
-
repo owner -
repo owner The previous comment was probably not right. For what I'm seeing, I should probably modify draw_instance_at() at librender/g_instance.c instead of mod_grproc. The locals should go in librender, too.
-
repo owner This'll also need to be supported by the following:
- mouse
- map_xputnp
- xput
- ¿Software blitting?
-
repo owner Commit a50d2ce provides an initial implementation by defining three local vars: MODR, MODG, MODB with values ranging 0-255 that control per-channel colour modulation.
As I said, there are some missing pieces, but the basic funtionality should be there.
-
repo owner - changed status to resolved
Closing this bug report.
The blitting side is done, and these effects can be regarded in the same way alpha is: since modr, modg and modb are effects applied to how a process looks, they needn't apply to the graphics themselves.
- Log in to comment
Thanks for the report.
Implementing this involves adding three local variables in mod_grproc (one per channel) and making changes to draw_at at mod_grproc/mod_grproc.c and gr_blit in libblit/gr_blit.c, so that the latter accepts the values as inputs and acts accordingly.