Modify the material color of the model in RENDERWARE

xiaoxiao2021-03-30  222

Set atomic for a certain color:

Set Geometry Signs, Flag & (~ RPGeometrytexTured) | RPGeometryModulateMareColor. Then set each METRIAL color as this color.

Pay attention to Geometry shared.

Give geometry to set color and recovery methods

Set color RpGeometrysetFlags (PGEOMEGRY, RPGEOMETRYGETFLAGS (PGEOMEGRY) & (~ RPGEMETRYTEXTED) | RPGEOMETRYMODULATEMATERIALCOLOR);

For (int i = rpGeometrygetNummaterials (PGEOMEGRY); i-> 0;)

{

PMATERIAL = RPGeometrygetMaterial (PGEOMEGRY, I);

/ / Save Material color

RPMaterialsetColor (PMATERIAL, PNEWCOLOR);

}

Recovery Colors RpGeometrysetFlags (PGEOMEGRY, RPGEOMETRYGETFLAGS (PGEOMEGRY) | RpGeometryTextured & (~ RpGeometryModulateMarectOLOR);

Then recover the original color stored during the color process.

However, because Geometry is shared, it is necessary to copy one copy, otherwise it will affect other roles.

转载请注明原文地址:https://www.9cbs.com/read-130506.html

New Post(0)