Calculate lighting for 2D3D?

This is what I have so far. It’s realllyyy inaccurate. Does anyone know the right way to do this?



		local computelight = render.ComputeLighting( tr.HitPos, tr.HitNormal )
		local dynamiclight = render.ComputeDynamicLighting( tr.HitPos, tr.HitNormal )
		local ambient = render.GetAmbientLightColor()
		local color1 = ( computelight[1] + ambient[1] ) / 2
		local color2 = ( computelight[2] + ambient[2] ) / 2
		local color3 = ( computelight[3] + ambient[3] ) / 2
		tbl.col = Color( color1 * 255, color2 * 255, color3 * 255 )
		table.insert(FootSteps, tbl)


What do you mean by calculating lighting? Why are you using 3D2D for it?

Well, this is what I use to calculate the RGB values I use for lighting. I just want to find a way to make the correct RGB values calculated. I render it with Cam3D.



		render.SetMaterial( footstep.foot )
				render.DrawQuadEasy( footstep.pos + footstep.normal * 0.5, footstep.normal, 10, 20, footstep.col, footstep.angle )

Is there a better function for it? The lighting doesn’t seem to be accurate.