<commit_before>-----------------------------------------------------------------------------
-- |
-- Copyright   : (C) 2014 <NAME>
-- License     : BSD3
--
-- Maintainer  : <NAME> <<EMAIL>>
-- Stability   : experimental
-- Portability : portable
--
----------------------------------------------------------------------------

module Photon.Render.Forward.Renderer where

import Control.Applicative
import Control.Lens ( makeLenses )
import Control.Monad.Error.Class ( MonadError )
import Control.Monad.Trans ( MonadIO )
import Graphics.UI.GLFW ( Window )
import Numeric.Natural ( Natural )
import Photon.Render.Forward.Accumulation ( Accumulation, getAccumulation )
import Photon.Render.Forward.Lighting ( Lighting, getLighting )
import Photon.Render.Forward.Shadowing ( Shadowing, getShadowing )
import Photon.Utils.Log

data ForwardRenderer = ForwardRenderer {
    _frLighting :: Lighting
  , _frShadowing :: Shadowing
  , _frAccumulation :: Accumulation
  , _frWindow :: Window
  }

makeLenses ''ForwardRenderer

getForwardRenderer :: (Applicative m,MonadIO m,MonadLogger m,MonadError Log m)
                   => Natural
                   -> Natural
                   -> Window
                   -> m ForwardRenderer
getForwardRenderer w h window =
  ForwardRenderer
    <$> getLighting w h
    <*> getShadowing w h 2048
    <*> getAccumulation w h
    <*> pure window<commit_msg>We can now set shadowmaps quality in user code.<commit_after>-----------------------------------------------------------------------------
-- |
-- Copyright   : (C) 2014 <NAME>
-- License     : BSD3
--
-- Maintainer  : <NAME> <<EMAIL>>
-- Stability   : experimental
-- Portability : portable
--
----------------------------------------------------------------------------

module Photon.Render.Forward.Renderer where

import Control.Applicative
import Control.Lens ( makeLenses )
import Control.Monad.Error.Class ( MonadError )
import Control.Monad.Trans ( MonadIO )
import Graphics.UI.GLFW ( Window )
import Numeric.Natural ( Natural )
import Photon.Render.Forward.Accumulation ( Accumulation, getAccumulation )
import Photon.Render.Forward.Lighting ( Lighting, getLighting )
import Photon.Render.Forward.Shadowing ( Shadowing, getShadowing )
import Photon.Utils.Log

data ForwardRenderer = ForwardRenderer {
    _frLighting :: Lighting
  , _frShadowing :: Shadowing
  , _frAccumulation :: Accumulation
  , _frWindow :: Window
  }

makeLenses ''ForwardRenderer

getForwardRenderer :: (Applicative m,MonadIO m,MonadLogger m,MonadError Log m)
                   => Natural
                   -> Natural
                   -> Natural
                   -> Window
                   -> m ForwardRenderer
getForwardRenderer w h shadowDef window =
  ForwardRenderer
    <$> getLighting w h
    <*> getShadowing w h (256+shadowDef*256)
    <*> getAccumulation w h
    <*> pure window
{'fraction_non_alphanumeric': 0.1944153577661431, 'fraction_numerical': 0.006980802792321117, 'mean_word_length': 2.032804232804233, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7304542', 'n_tokens_mistral': 790, 'n_tokens_neox': 749, 'n_words': 189}