Everybody's most favorite answer: it depends. I use a laser with VCarvepro 8.5. Only thing it took was making a custom post processor. In my case I just use one power setting with on / off commands. Vary the amount of burn by changing the feed rate.

The depth variation to Z could feed a DAC / PWM and convert the data to power levels. I suspect that the simple way to go is just get a photo laser software. They generate g code to a spare motor axis ( mach 3 ) for power control.