Spatiotemporal pattern formation and chaos in passive optical systems