# Raycaster class

Namespace: [Grasshopper2.Imaging.Raycasting](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.imaging.raycasting.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class Raycaster : IObjectStack
```

Type for populating images with a raycasting technique.

## Constructors

- [Raycaster](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/ctor.md): (2 overloads) Create a new raycaster.

## Fields

- [MaxSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/maxsize.md): (static) Specifies the maximum linear size (in pixels) of a raycasting image.

## Properties

- [Background](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/background.md): Gets the background shader. This shader may be null, in which case a fully transparent background is implied.
- [CurrentSamplingLevel](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/currentsamplinglevel.md): Gets the current sampling level. Not all pixels are necessarily being sampled at this level though, only at least one of them is. Negative sampling levels indicate a coarse sampling, every (-N)th pixels.
- [Height](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/height.md): Gets the height of the raycasting image.
- [Width](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/width.md): Gets the width of the raycasting image.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/item.md): (2 overloads) Gets the pixel at the given coordinates.

## Methods

- [ComputeImage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/computeimage.md): Start a new raycasting process.
- [ComputeImageAsync](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/computeimageasync.md): Start the image computation asynchronously.
- [ContinueAndSample](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/continueandsample.md): Continue an existing ray.
- [ContinueImage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/continueimage.md): Continue a finished raycasting process. This method cannot be called while a process is already running.
- [ContinueImageAsync](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/continueimageasync.md): Continue a finished raycasting process asynchronously. This method cannot be called while a process is already running.
- [FirstObjectAbove](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/firstobjectabove.md): Find the index of the first object at the (u,v) location at or above the given layer index.
- [FirstObjectBelow](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/firstobjectbelow.md): Find the index of the first object at the (u,v) location at or below the given layer index.
- [ResurrectAllPixels](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/resurrectallpixels.md): (2 overloads) Move all dead pixels back onto the alive list.
- [Sample](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/sample.md): Shoot a way into the object stack and evaluate the colour.
- [ToBitmap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/tobitmap.md): (2 overloads) Create a bitmap from the current cache.
- [ToBucketMap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/tobucketmap.md): Create a bitmap showing the bucket occupancy.
- [ToCompletionMap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.raycasting.raycaster/tocompletionmap.md): (2 overloads) Create a bitmap showing the completed pixels vs the live pixels.
