# Class: l3dview

l3dview is used to render a l3dset. You can specify camera, background and fog for each l3dview.Every l3dset has one default l3dview, which cannot be deleted. Additionally you can register more l3dviews which are processed before the default views.The l3dnodes can be made visible only to certain cameras. By default they are visible to the default camera.
Another special purpose of l3dviews is rendering to a texture.

## Hierarchy

    o-+ l3dlist
      o-+ l3dview

## Interfaces:

- matobject

## Methods:

### Method overview:

- activate
- backgroundfirst
- backgroundmatsurface
- baseshaders
- camera
- clearcolor
- clearcolorvalue
- cleardepth
- cleardepthvalue
- clearstencil
- clearstencilvalue
- deactivate
- defaultcamvisflag
- delete
- depthonly
- disablesorting
- drawcamaxis
- ffxvisflag
- fogcolor
- fogdensity
- fogend
- fogstart
- fogstate
- forceflags
- ignoreflags
- ignoreframefx
- ignorelights
- ignoreparticles
- ignoreprojectors
- manualbackground
- new
- polygonoffset
- rendertotexture
- shaderstage
- skybox
- skydome
- usebaseshaders
- usepolygonoffset
- viewpos
- viewrefbounds
- viewsize
- windowsized

new ()
  returns: (l3dview)
  returns a new l3dview.
activate (l3dview,l3dset)
  returns: ()
  activates the l3dview in the given set. Activate inserts the l3dview as first in the list. Has no effect on defaultviews
backgroundfirst (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if backgroundmatsurface/skybox/skydome should be drawn first. By default this is off, because it is more efficient for rendering. However if you need the background first to blend ontop, you must set this to true. You can also use manualbackground combined with a framefx.clear for more control on when drawing it.
backgroundmatsurface (l3dview,[matsurface])
  returns: ([matsurface])
  returns or sets matsurface, disabled when 2nd arg is not a matsurface
baseshaders (l3dview,[shader color-only,shader color_lightmap,shader 1tex,shader 1tex_lightmap])
  returns: ([shader color-only,shader color_lightmap,shader 1tex,shader 1tex_lightmap])
  returns or sets baseshaders. Any non-material mesh, ie just having a texture or just having a color, will use those shaders and pass its texture (if exists) as Texture:0 to the shader.
camera (l3dview,[camera])
  returns: (camera)
  returns or sets camera, disabled when 2nd arg is not a camera. If disabled we will use default camera.
clearcolor (l3dview,[boolean])
  returns: ([boolean])
  returns or sets
clearcolorvalue (l3dview,[float r,g,b,a])
  returns: ([float r,g,b,a])
  returns or sets
cleardepth (l3dview,[boolean])
  returns: ([boolean])
  returns or sets
cleardepthvalue (l3dview,[float 0-1])
  returns: ([float])
  returns or sets
clearstencil (l3dview,[boolean])
  returns: ([boolean])
  returns or sets
clearstencilvalue (l3dview,[int])
  returns: ([int])
  returns or sets
deactivate (l3dview)
  returns: ()
  deactivates the l3dview. Has no effect on defaultviews
defaultcamvisflag (l3dview,int id,[boolean])
  returns: ([boolean])
  sets camera visibility bit flag if a default camera is used for this view. It overrides the visflag of the camera itself, however culling is done before and based on the original camera bitid.
delete (l3dview)
  returns: ()
  deletes the l3dview. Has no effect on defaultviews
depthonly (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if a pure Z write should be done.
disablesorting (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if sorting within layers should be disabled. The camera distance based layers will still be sorted.
drawcamaxis (l3dview,[boolean])
  returns: ([boolean])
  draws camera orientation
ffxvisflag (l3dview,int id,[boolean])
  returns: ([boolean])
  sets framefx visibility bit flag. If visflag of framefx AND its own flag bitwise return true, then the fx will be drawn in the current l3dview. id = 0..31
fogcolor (l3dview,[float r,g,b,a])
  returns: ([float r,g,b,a])
  returns or sets
fogdensity (l3dview,[float])
  returns: ([float])
  returns or sets
fogend (l3dview,[float])
  returns: ([float])
  returns or sets
fogstart (l3dview,[float])
  returns: ([float])
  returns or sets
fogstate (l3dview,[boolean])
  returns: ([boolean])
  returns or sets
forceflags (l3dview,[renderflag])
  returns: ([renderflag])
  returns or sets renderflag that will be enforced.
ignoreflags (l3dview,[renderflag])
  returns: ([renderflag])
  returns or sets renderflag that should be ignored.
ignoreframefx (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if framefx should not be executed.
ignorelights (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if lights should be turned off.
ignoreparticles (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if particle rendering should not be done.
ignoreprojectors (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if projectors should be disabled.
manualbackground (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if backgroundmatsurface/skybox/skydome should not be drawn. If you want to manually decide when to draw the background you can do so with the framefx.clear type. By default this is off and backgroundfirst is false (rendered last).
polygonoffset (l3dview,[float scale,bias])
  returns: ([float scale,bias])
  returns or sets the polygonoffset values..
rendertotexture (l3dview,[texture],[int side])
  returns: ([texture])
  if you pass a texture the outcome of the rendering will be saved to it. The windowsized and viewWidth/viewHeight values will be set from the texture. If you pass a non-texture as argument the rendertotexture will be disabled.
  side is 0-5 and resembles the side of a cubemap +x,-x,+y,-y,+z,-z. Warning: view/texsize must always be smaller than current window resolution.
shaderstage (l3dview,[int 0-3])
  returns: ([int])
  returns or sets shaderstage of the material. A material can define up to 4 shaders, the id that you pass here will be used. If a material does not have a shader with the given id, we will use the color-only baseshader. Only active if usebaseshaders is true.
skybox (l3dview,[skybox])
  returns: ([skybox])
  returns or sets skybox, disabled when 2nd arg is not a skybox
skydome (l3dview,[skydome])
  returns: ([skydome])
  returns or sets skydome, disabled when 2nd arg is not a skydome
usebaseshaders (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if baseshaders should be used. Make sure they are specified before.
usepolygonoffset (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if depth values are changed depending on slope and constant factors when depth testing occurs.
viewpos (l3dview,[int x,y])
  returns: ([int x,y])
  returns or sets the viewport starting position in pixels. 0,0 is bottom left, which is not as in list2d. only used when windowsized is false
viewrefbounds (l3dview,[float refx,refy,refwidth,refheight])
  returns: ([float refx,refy,refwidth,refheight])
  returns or sets the viewport size and position in reference coordinates. only used when windowsized is false. Warning: viewsize must always be smaller than current window refsize.
viewsize (l3dview,[int width,height])
  returns: ([int width,height])
  returns or sets the viewport size in pixels. only used when windowsized is false. Warning: viewsize must always be smaller than current window resolution.
windowsized (l3dview,[boolean])
  returns: ([boolean])
  returns or sets if the viewport should use the full window size.

## Inherited Methods:

### From l3dlist

reinit