-----------------------------------------------------------------------------
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
module THREE.ShaderMaterial
  ( -- * Types
    ShaderMaterial (..)
  , ShaderMaterialClass (..)
    -- * Constructors
  , THREE.ShaderMaterial.new
  ) where
-----------------------------------------------------------------------------
import           Miso
-----------------------------------------------------------------------------
import           THREE.Constants.Materials
import           THREE.EventDispatcher
import           THREE.Internal as THREE
import           THREE.Material
-----------------------------------------------------------------------------
-- | https://threejs.org/docs/#api/en/materials/ShaderMaterial
class (Material material) => ShaderMaterialClass material where

  -- Property

  clipping :: Property material Bool
  clipping = MisoString -> Property material Bool
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"clipping"

  defaultAttributeValues :: Property material Object    -- TODO implement something more practical than JS Object?
  defaultAttributeValues = MisoString -> Property material Object
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"defaultAttributeValues"

  defines :: Property material Object
  defines = MisoString -> Property material Object
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"defines"

  extensions :: Property material Object
  extensions = MisoString -> Property material Object
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"extensions"

  fog :: Property material Bool
  fog = MisoString -> Property material Bool
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"fog"

  fragmentShader :: Property material MisoString
  fragmentShader = MisoString -> Property material MisoString
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"fragmentShader"

  glslVersion :: Property material GlslVersion
  glslVersion = MisoString -> Property material GlslVersion
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"glslVersion"

  index0AttributeName :: Property material (Maybe MisoString)
  index0AttributeName = MisoString -> Property material (Maybe MisoString)
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object (Maybe field)
optional MisoString
"index0AttributeName"

  lights :: Property material Bool
  lights = MisoString -> Property material Bool
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"lights"

  linewidth :: Property material Double
  linewidth = MisoString -> Property material Double
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"linewidth"

  flatShading :: Property material Bool
  flatShading = MisoString -> Property material Bool
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"flatShading"

  uniforms :: Property material Object
  uniforms = MisoString -> Property material Object
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"uniforms"

  uniformsNeedUpdate :: Property material Bool
  uniformsNeedUpdate = MisoString -> Property material Bool
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"uniformsNeedUpdate"

  vertexColors :: Property material Bool
  vertexColors = MisoString -> Property material Bool
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"vertexColors"

  vertexShader :: Property material MisoString
  vertexShader = MisoString -> Property material MisoString
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"vertexShader"

  wireframe :: Property material Bool
  wireframe = MisoString -> Property material Bool
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"wireframe"

  wireframeLinewidth :: Property material Double
  wireframeLinewidth = MisoString -> Property material Double
forall object field.
(ToObject object, ToJSVal field, FromJSVal field) =>
MisoString -> Property object field
property MisoString
"wireframeLinewidth"

instance ShaderMaterialClass JSVal

-----------------------------------------------------------------------------

newtype ShaderMaterial
  = ShaderMaterial
  { ShaderMaterial -> JSVal
unShaderMaterial :: JSVal
  } deriving newtype (ShaderMaterial -> IO [JSVal]
(ShaderMaterial -> IO [JSVal]) -> ToArgs ShaderMaterial
forall args. (args -> IO [JSVal]) -> ToArgs args
$ctoArgs :: ShaderMaterial -> IO [JSVal]
toArgs :: ShaderMaterial -> IO [JSVal]
ToArgs, ShaderMaterial -> IO Object
(ShaderMaterial -> IO Object) -> ToObject ShaderMaterial
forall a. (a -> IO Object) -> ToObject a
$ctoObject :: ShaderMaterial -> IO Object
toObject :: ShaderMaterial -> IO Object
ToObject, ShaderMaterial -> IO JSVal
(ShaderMaterial -> IO JSVal) -> ToJSVal ShaderMaterial
forall a. (a -> IO JSVal) -> ToJSVal a
$ctoJSVal :: ShaderMaterial -> IO JSVal
toJSVal :: ShaderMaterial -> IO JSVal
ToJSVal)
    deriving anyclass (ToObject ShaderMaterial
ToJSVal ShaderMaterial
Property ShaderMaterial Bool
Property ShaderMaterial Double
Property ShaderMaterial Int
Property ShaderMaterial (Maybe [Plane])
Property ShaderMaterial (Maybe MisoString)
Property ShaderMaterial (Maybe Object)
Property ShaderMaterial (Maybe BlendingEquations)
Property ShaderMaterial (Maybe DestinationFactors)
Property ShaderMaterial (Maybe SourceFactors)
Property ShaderMaterial (Maybe BlendingMode)
Property ShaderMaterial MisoString
Property ShaderMaterial Object
Property ShaderMaterial BlendingEquations
Property ShaderMaterial SourceFactors
Property ShaderMaterial DepthMode
Property ShaderMaterial Side
Property ShaderMaterial StencilFunctions
Property ShaderMaterial StencilOperations
Property ShaderMaterial Color
ReadOnly ShaderMaterial Bool
ReadOnly ShaderMaterial MisoString
EventDispatcher ShaderMaterial
Method ShaderMaterial () ()
Method ShaderMaterial () MisoString
Method ShaderMaterial Object ()
Method ShaderMaterial Object Object
FromJSVal ShaderMaterial => Method ShaderMaterial () ShaderMaterial
(FromJSVal ShaderMaterial, ToArgs ShaderMaterial) =>
Method ShaderMaterial ShaderMaterial ShaderMaterial
(EventDispatcher ShaderMaterial, ToJSVal ShaderMaterial,
 ToObject ShaderMaterial) =>
ReadOnly ShaderMaterial MisoString
-> ReadOnly ShaderMaterial MisoString
-> ReadOnly ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Double
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Double
-> Property ShaderMaterial Color
-> Property ShaderMaterial (Maybe DestinationFactors)
-> Property ShaderMaterial (Maybe DestinationFactors)
-> Property ShaderMaterial BlendingEquations
-> Property ShaderMaterial (Maybe BlendingEquations)
-> Property ShaderMaterial (Maybe BlendingMode)
-> Property ShaderMaterial SourceFactors
-> Property ShaderMaterial (Maybe SourceFactors)
-> Property ShaderMaterial Bool
-> Property ShaderMaterial (Maybe [Plane])
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial (Maybe Object)
-> Property ShaderMaterial DepthMode
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Int
-> Property ShaderMaterial StencilFunctions
-> Property ShaderMaterial Int
-> Property ShaderMaterial Int
-> Property ShaderMaterial StencilOperations
-> Property ShaderMaterial StencilOperations
-> Property ShaderMaterial StencilOperations
-> Property ShaderMaterial Int
-> Property ShaderMaterial MisoString
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Double
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Int
-> Property ShaderMaterial Int
-> Property ShaderMaterial (Maybe MisoString)
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Side
-> Property ShaderMaterial Side
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Int
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Object
-> (FromJSVal ShaderMaterial =>
    Method ShaderMaterial () ShaderMaterial)
-> ((FromJSVal ShaderMaterial, ToArgs ShaderMaterial) =>
    Method ShaderMaterial ShaderMaterial ShaderMaterial)
-> Method ShaderMaterial () ()
-> Method ShaderMaterial () MisoString
-> Method ShaderMaterial Object ()
-> Method ShaderMaterial Object Object
-> Material ShaderMaterial
forall material.
(EventDispatcher material, ToJSVal material, ToObject material) =>
ReadOnly material MisoString
-> ReadOnly material MisoString
-> ReadOnly material Bool
-> Property material Bool
-> Property material Double
-> Property material Bool
-> Property material Double
-> Property material Color
-> Property material (Maybe DestinationFactors)
-> Property material (Maybe DestinationFactors)
-> Property material BlendingEquations
-> Property material (Maybe BlendingEquations)
-> Property material (Maybe BlendingMode)
-> Property material SourceFactors
-> Property material (Maybe SourceFactors)
-> Property material Bool
-> Property material (Maybe [Plane])
-> Property material Bool
-> Property material Bool
-> Property material (Maybe Object)
-> Property material DepthMode
-> Property material Bool
-> Property material Bool
-> Property material Bool
-> Property material Bool
-> Property material Int
-> Property material StencilFunctions
-> Property material Int
-> Property material Int
-> Property material StencilOperations
-> Property material StencilOperations
-> Property material StencilOperations
-> Property material Int
-> Property material MisoString
-> Property material Bool
-> Property material Double
-> Property material Bool
-> Property material Int
-> Property material Int
-> Property material (Maybe MisoString)
-> Property material Bool
-> Property material Bool
-> Property material Side
-> Property material Side
-> Property material Bool
-> Property material Bool
-> Property material Int
-> Property material Bool
-> Property material Bool
-> Property material Object
-> (FromJSVal material => Method material () material)
-> ((FromJSVal material, ToArgs material) =>
    Method material material material)
-> Method material () ()
-> Method material () MisoString
-> Method material Object ()
-> Method material Object Object
-> Material material
$ctype_ :: ReadOnly ShaderMaterial MisoString
type_ :: ReadOnly ShaderMaterial MisoString
$cuuid :: ReadOnly ShaderMaterial MisoString
uuid :: ReadOnly ShaderMaterial MisoString
$cisMaterial :: ReadOnly ShaderMaterial Bool
isMaterial :: ReadOnly ShaderMaterial Bool
$calphaHash :: Property ShaderMaterial Bool
alphaHash :: Property ShaderMaterial Bool
$calphaTest :: Property ShaderMaterial Double
alphaTest :: Property ShaderMaterial Double
$calphaToCoverage :: Property ShaderMaterial Bool
alphaToCoverage :: Property ShaderMaterial Bool
$cblendAlpha :: Property ShaderMaterial Double
blendAlpha :: Property ShaderMaterial Double
$cblendColor :: Property ShaderMaterial Color
blendColor :: Property ShaderMaterial Color
$cblendDst :: Property ShaderMaterial (Maybe DestinationFactors)
blendDst :: Property ShaderMaterial (Maybe DestinationFactors)
$cblendDstAlpha :: Property ShaderMaterial (Maybe DestinationFactors)
blendDstAlpha :: Property ShaderMaterial (Maybe DestinationFactors)
$cblendEquation :: Property ShaderMaterial BlendingEquations
blendEquation :: Property ShaderMaterial BlendingEquations
$cblendEquationAlpha :: Property ShaderMaterial (Maybe BlendingEquations)
blendEquationAlpha :: Property ShaderMaterial (Maybe BlendingEquations)
$cblending :: Property ShaderMaterial (Maybe BlendingMode)
blending :: Property ShaderMaterial (Maybe BlendingMode)
$cblendSrc :: Property ShaderMaterial SourceFactors
blendSrc :: Property ShaderMaterial SourceFactors
$cblendSrcAlpha :: Property ShaderMaterial (Maybe SourceFactors)
blendSrcAlpha :: Property ShaderMaterial (Maybe SourceFactors)
$cclipIntersection :: Property ShaderMaterial Bool
clipIntersection :: Property ShaderMaterial Bool
$cclippingPlanes :: Property ShaderMaterial (Maybe [Plane])
clippingPlanes :: Property ShaderMaterial (Maybe [Plane])
$cclipShadows :: Property ShaderMaterial Bool
clipShadows :: Property ShaderMaterial Bool
$ccolorWrite :: Property ShaderMaterial Bool
colorWrite :: Property ShaderMaterial Bool
$cdefines :: Property ShaderMaterial (Maybe Object)
defines :: Property ShaderMaterial (Maybe Object)
$cdepthFunc :: Property ShaderMaterial DepthMode
depthFunc :: Property ShaderMaterial DepthMode
$cdepthTest :: Property ShaderMaterial Bool
depthTest :: Property ShaderMaterial Bool
$cdepthWrite :: Property ShaderMaterial Bool
depthWrite :: Property ShaderMaterial Bool
$cforceSinglePass :: Property ShaderMaterial Bool
forceSinglePass :: Property ShaderMaterial Bool
$cstencilWrite :: Property ShaderMaterial Bool
stencilWrite :: Property ShaderMaterial Bool
$cstencilWriteMask :: Property ShaderMaterial Int
stencilWriteMask :: Property ShaderMaterial Int
$cstencilFunc :: Property ShaderMaterial StencilFunctions
stencilFunc :: Property ShaderMaterial StencilFunctions
$cstencilRef :: Property ShaderMaterial Int
stencilRef :: Property ShaderMaterial Int
$cstencilFuncMask :: Property ShaderMaterial Int
stencilFuncMask :: Property ShaderMaterial Int
$cstencilFail :: Property ShaderMaterial StencilOperations
stencilFail :: Property ShaderMaterial StencilOperations
$cstencilZFail :: Property ShaderMaterial StencilOperations
stencilZFail :: Property ShaderMaterial StencilOperations
$cstencilZPass :: Property ShaderMaterial StencilOperations
stencilZPass :: Property ShaderMaterial StencilOperations
$cid :: Property ShaderMaterial Int
id :: Property ShaderMaterial Int
$cname :: Property ShaderMaterial MisoString
name :: Property ShaderMaterial MisoString
$cneedsUpdate :: Property ShaderMaterial Bool
needsUpdate :: Property ShaderMaterial Bool
$copacity :: Property ShaderMaterial Double
opacity :: Property ShaderMaterial Double
$cpolygonOffset :: Property ShaderMaterial Bool
polygonOffset :: Property ShaderMaterial Bool
$cpolygonOffsetFactor :: Property ShaderMaterial Int
polygonOffsetFactor :: Property ShaderMaterial Int
$cpolygonOffsetUnits :: Property ShaderMaterial Int
polygonOffsetUnits :: Property ShaderMaterial Int
$cprecision :: Property ShaderMaterial (Maybe MisoString)
precision :: Property ShaderMaterial (Maybe MisoString)
$cpremultipliedAlpha :: Property ShaderMaterial Bool
premultipliedAlpha :: Property ShaderMaterial Bool
$cdithering :: Property ShaderMaterial Bool
dithering :: Property ShaderMaterial Bool
$cshadowSide :: Property ShaderMaterial Side
shadowSide :: Property ShaderMaterial Side
$cside :: Property ShaderMaterial Side
side :: Property ShaderMaterial Side
$ctoneMapped :: Property ShaderMaterial Bool
toneMapped :: Property ShaderMaterial Bool
$ctransparent :: Property ShaderMaterial Bool
transparent :: Property ShaderMaterial Bool
$cversion :: Property ShaderMaterial Int
version :: Property ShaderMaterial Int
$cvertexColors :: Property ShaderMaterial Bool
vertexColors :: Property ShaderMaterial Bool
$cvisible :: Property ShaderMaterial Bool
visible :: Property ShaderMaterial Bool
$cuserData :: Property ShaderMaterial Object
userData :: Property ShaderMaterial Object
$cclone :: FromJSVal ShaderMaterial => Method ShaderMaterial () ShaderMaterial
clone :: FromJSVal ShaderMaterial => Method ShaderMaterial () ShaderMaterial
$ccopy :: (FromJSVal ShaderMaterial, ToArgs ShaderMaterial) =>
Method ShaderMaterial ShaderMaterial ShaderMaterial
copy :: (FromJSVal ShaderMaterial, ToArgs ShaderMaterial) =>
Method ShaderMaterial ShaderMaterial ShaderMaterial
$cdispose :: Method ShaderMaterial () ()
dispose :: Method ShaderMaterial () ()
$ccustomProgramCacheKey :: Method ShaderMaterial () MisoString
customProgramCacheKey :: Method ShaderMaterial () MisoString
$csetValues :: Method ShaderMaterial Object ()
setValues :: Method ShaderMaterial Object ()
$ctoJSON :: Method ShaderMaterial Object Object
toJSON :: Method ShaderMaterial Object Object
Material, ToObject ShaderMaterial
ToJSVal ShaderMaterial
Method ShaderMaterial (MisoString, Function) ()
Method ShaderMaterial Object ()
(ToObject ShaderMaterial, ToJSVal ShaderMaterial) =>
Method ShaderMaterial (MisoString, Function) ()
-> Method ShaderMaterial (MisoString, Function) ()
-> Method ShaderMaterial (MisoString, Function) ()
-> Method ShaderMaterial Object ()
-> EventDispatcher ShaderMaterial
forall object.
(ToObject object, ToJSVal object) =>
Method object (MisoString, Function) ()
-> Method object (MisoString, Function) ()
-> Method object (MisoString, Function) ()
-> Method object Object ()
-> EventDispatcher object
$caddEventListener :: Method ShaderMaterial (MisoString, Function) ()
addEventListener :: Method ShaderMaterial (MisoString, Function) ()
$chasEventListener :: Method ShaderMaterial (MisoString, Function) ()
hasEventListener :: Method ShaderMaterial (MisoString, Function) ()
$cremoveEventListener :: Method ShaderMaterial (MisoString, Function) ()
removeEventListener :: Method ShaderMaterial (MisoString, Function) ()
$cdispatchEvent :: Method ShaderMaterial Object ()
dispatchEvent :: Method ShaderMaterial Object ()
EventDispatcher, Property ShaderMaterial Bool
Property ShaderMaterial Double
Property ShaderMaterial (Maybe MisoString)
Property ShaderMaterial MisoString
Property ShaderMaterial Object
Property ShaderMaterial GlslVersion
Material ShaderMaterial
Material ShaderMaterial =>
Property ShaderMaterial Bool
-> Property ShaderMaterial Object
-> Property ShaderMaterial Object
-> Property ShaderMaterial Object
-> Property ShaderMaterial Bool
-> Property ShaderMaterial MisoString
-> Property ShaderMaterial GlslVersion
-> Property ShaderMaterial (Maybe MisoString)
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Double
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Object
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Bool
-> Property ShaderMaterial MisoString
-> Property ShaderMaterial Bool
-> Property ShaderMaterial Double
-> ShaderMaterialClass ShaderMaterial
forall material.
Material material =>
Property material Bool
-> Property material Object
-> Property material Object
-> Property material Object
-> Property material Bool
-> Property material MisoString
-> Property material GlslVersion
-> Property material (Maybe MisoString)
-> Property material Bool
-> Property material Double
-> Property material Bool
-> Property material Object
-> Property material Bool
-> Property material Bool
-> Property material MisoString
-> Property material Bool
-> Property material Double
-> ShaderMaterialClass material
$cclipping :: Property ShaderMaterial Bool
clipping :: Property ShaderMaterial Bool
$cdefaultAttributeValues :: Property ShaderMaterial Object
defaultAttributeValues :: Property ShaderMaterial Object
$cdefines :: Property ShaderMaterial Object
defines :: Property ShaderMaterial Object
$cextensions :: Property ShaderMaterial Object
extensions :: Property ShaderMaterial Object
$cfog :: Property ShaderMaterial Bool
fog :: Property ShaderMaterial Bool
$cfragmentShader :: Property ShaderMaterial MisoString
fragmentShader :: Property ShaderMaterial MisoString
$cglslVersion :: Property ShaderMaterial GlslVersion
glslVersion :: Property ShaderMaterial GlslVersion
$cindex0AttributeName :: Property ShaderMaterial (Maybe MisoString)
index0AttributeName :: Property ShaderMaterial (Maybe MisoString)
$clights :: Property ShaderMaterial Bool
lights :: Property ShaderMaterial Bool
$clinewidth :: Property ShaderMaterial Double
linewidth :: Property ShaderMaterial Double
$cflatShading :: Property ShaderMaterial Bool
flatShading :: Property ShaderMaterial Bool
$cuniforms :: Property ShaderMaterial Object
uniforms :: Property ShaderMaterial Object
$cuniformsNeedUpdate :: Property ShaderMaterial Bool
uniformsNeedUpdate :: Property ShaderMaterial Bool
$cvertexColors :: Property ShaderMaterial Bool
vertexColors :: Property ShaderMaterial Bool
$cvertexShader :: Property ShaderMaterial MisoString
vertexShader :: Property ShaderMaterial MisoString
$cwireframe :: Property ShaderMaterial Bool
wireframe :: Property ShaderMaterial Bool
$cwireframeLinewidth :: Property ShaderMaterial Double
wireframeLinewidth :: Property ShaderMaterial Double
ShaderMaterialClass)

instance FromJSVal ShaderMaterial where
  fromJSVal :: JSVal -> IO (Maybe ShaderMaterial)
fromJSVal = Maybe ShaderMaterial -> IO (Maybe ShaderMaterial)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe ShaderMaterial -> IO (Maybe ShaderMaterial))
-> (JSVal -> Maybe ShaderMaterial)
-> JSVal
-> IO (Maybe ShaderMaterial)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShaderMaterial -> Maybe ShaderMaterial
forall a. a -> Maybe a
Just (ShaderMaterial -> Maybe ShaderMaterial)
-> (JSVal -> ShaderMaterial) -> JSVal -> Maybe ShaderMaterial
forall b c a. (b -> c) -> (a -> b) -> a -> c
. JSVal -> ShaderMaterial
ShaderMaterial

-- Constructor

new :: THREE.Three ShaderMaterial
new :: IO ShaderMaterial
new = (JSVal -> ShaderMaterial) -> MisoString -> () -> IO ShaderMaterial
forall args con.
ToArgs args =>
(JSVal -> con) -> MisoString -> args -> Three con
THREE.new JSVal -> ShaderMaterial
ShaderMaterial MisoString
"ShaderMaterial" ()