#pragma annotation "grouping" "BAKING/readme;"
#pragma annotation readme "gadgettype=floatfield;label=README;hint=Select one. You MUST add the attributes at the top of the shader file comments to your PreWorldMEL. Use Shading Rate and Image Resolution to control PTC Density. If you're having artifact problems, just increase the PTC density if decreasing the bias doesn't help. It's also important to pick a camera that can 'see' everything you need a PTC for in the scene."
#pragma annotation "grouping" "BAKING/bake_AREA;"
#pragma annotation bake_AREA "gadgettype=checkbox:0:1=custom value;label=Bake area data;hint=This can be used for occlusion and lighting occlusion style with HDRI."
#pragma annotation "grouping" "BAKING/bake_COLOR;"
#pragma annotation bake_COLOR "gadgettype=checkbox:0:1=custom value;label=Bake color/area data;hint=This is needed for GI but can also be used for everything else."
#pragma annotation "grouping" "BAKING/filename;"
#pragma annotation filename "gadgettype=inputfile;label=PTC Filename;hint=Where the .ptc file gets baked to."
#pragma annotation "grouping" "BAKING/coordsyst;"
#pragma annotation coordsyst "gadgettype=inputfile;label=Coordinate system;hint=Which coordsystem to bake to. Default world."

volume
    cl_ptc_bake (
                string filename = "<project>/3delight/ptc/<scene>.#.ptc",
                coordsyst = "world";
                float bake_COLOR = 1,
                bake_AREA = 0,
                readme = 0;) 
    {
		normal Nn = normalize(N);
			if ((bake_AREA == 1) && (bake_COLOR == 0)){ // If only AREA is selected, only give area
					bake3d(filename, "",
						P, Nn, 
						"coordsystem", coordsyst, 
						"interpolate", 1,
						"_opacity", Oi);
				Ci *= 1;
				Oi *= 1;
			}else{ // if both, neither, or just COLOR was selected, default to the bake_COLOR
				color c=0;
				surface("Ci", c);
				
					bake3d( filename, "", 
						P, Nn, 
						"coordsystem", coordsyst,
						"interpolate", 1,
						"_radiosity", c,
						"_opacity", Oi);

				Ci *= 1;
				Oi *= 1;
			}
    }

