Modifing Masks at Runtime

Is there a way to Modify a Mask during run time? I’m looking to detect a collision with a textured object, then modify a mask on that textured object where the collision took place.

Hello DoctorBrowne,

Could you give me some context in which you are going to be doing this because you could try and use decals (fairly inexpensive) where you are having collision. An example of this would be bullets hitting a wall and creating bullet holes.

Thanks,

An artist I’m working with is trying to do a lot with in game changing environment, such as footprints in snow and smearing paint. Currently she is using either vertex points or a mask on the texture to create tessellation or switch between two different shaders. The idea is to have this all over the environment as the game progresses and for it to not fade away, so that’s why I was thinking of writing to a mask, that way there wouldn’t be multiple decals, as these should be all over and permanent. Also I don’t believe decals can deform objects.

That’s why I was thinking of adding masks to another mask. Such as on a foot step, I could add a mask of the foot to the ground’s texture mask for where there should be footprints. Also this would allow overlapping footprints or masks to add together to the final texture mask, instead of overlapping like decals.

Hello DoctorBrowne,

I did some investigating on this topic within our Forums because this is an effect a lot of people like to add to their games. I was able to find a Forum thread on the topic as well as an in depth example of how the game Batman: Arkham Origins achieves this effect.

Essentially it deals with blending different heightmaps to create the depth in which the footprints are displayed. The links below should give you some good direction as to how to implement this into your own project.

Forum Thread

GDC Vault Presentation

Let me know if you have further questions or need additional assistance.

Cheers,