\hypertarget{classACG_1_1ShaderModifier}{}\section{A\+CG\+:\+:Shader\+Modifier Class Reference}
\label{classACG_1_1ShaderModifier}\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}


{\ttfamily \#include $<$Open\+Flipper/libs\+\_\+required/\+A\+C\+G/\+G\+L/\+Shader\+Generator.\+hh$>$}

Inheritance diagram for A\+CG\+:\+:Shader\+Modifier\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=8.092485cm]{classACG_1_1ShaderModifier}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a0692498de2b752b70b8ac3afcbfb5212}{modify\+Vertex\+IO} (\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$\+\_\+shader)
\begin{DoxyCompactList}\small\item\em Add your own inputs/outputs to the vertex shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a501dd2d58dd6427bc91e39d89c94b94e}{modify\+Vertex\+Begin\+Code} (Q\+String\+List $\ast$\+\_\+code)
\begin{DoxyCompactList}\small\item\em Append code the the vertex shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a5f7d792c06eff3a8dda3656825db1691}{modify\+Vertex\+End\+Code} (Q\+String\+List $\ast$\+\_\+code)
\begin{DoxyCompactList}\small\item\em Append code the the vertex shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a18ccb497e9e46b32a10824c9409c9666}{modify\+Geometry\+IO} (\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$\+\_\+shader)
\begin{DoxyCompactList}\small\item\em Add your own inputs/outputs to the geometry shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a5258b3fadeb7e34345aabe87aaa5479c}{modify\+Tess\+Control\+IO} (\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$\+\_\+shader)
\begin{DoxyCompactList}\small\item\em Add your own inputs/outputs to the tessellation control shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a4bf90e17e6b02ae7d9fdffc96a890e07}{modify\+Tess\+Eval\+IO} (\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$\+\_\+shader)
\begin{DoxyCompactList}\small\item\em Add your own inputs/outputs to the tessellation evaluation shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_ae720c7104306f1e696e690760b928048}{modify\+Fragment\+IO} (\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$\+\_\+shader)
\begin{DoxyCompactList}\small\item\em Add your own inputs/outputs to the fragment shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a70fe99b722072abb212f210b75e11b4b}{modify\+Fragment\+Begin\+Code} (Q\+String\+List $\ast$\+\_\+code)
\begin{DoxyCompactList}\small\item\em Append code the the fragment shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a25b1e0be6dd4a8365ecb1c72da21d310}{modify\+Fragment\+End\+Code} (Q\+String\+List $\ast$\+\_\+code)
\begin{DoxyCompactList}\small\item\em Append code the the fragment shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{classACG_1_1ShaderModifier_a0d9329675647a8d2d7c9ebd66370a30b}{modify\+Lighting\+Code} (Q\+String\+List $\ast$\+\_\+code, int \+\_\+light\+Id, Shader\+Gen\+Light\+Type \+\_\+light\+Type)
\begin{DoxyCompactList}\small\item\em Modify the default lighting code of the shader generator. \end{DoxyCompactList}\item 
virtual bool \hyperlink{classACG_1_1ShaderModifier_a62cbca887ccde2f2953b8253886d47ee}{replace\+Default\+Lighting\+Code} ()
\begin{DoxyCompactList}\small\item\em Specify whether this modifier replaces or extends the default lighting code. \end{DoxyCompactList}\item 
unsigned int \hyperlink{classACG_1_1ShaderModifier_af0a569920d4cf8d1e080492862ddcabf}{get\+ID} ()
\begin{DoxyCompactList}\small\item\em Returns the modifier ID. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classACG_1_1ShaderModifier_aa9de89e7cbc98ff5cad4a9004dc0a9b0}\label{classACG_1_1ShaderModifier_aa9de89e7cbc98ff5cad4a9004dc0a9b0}} 
{\bfseries operator std\+::vector$<$ unsigned int $>$} () const
\item 
\mbox{\Hypertarget{classACG_1_1ShaderModifier_ad4990b509a8fe3bca25682a8fb0a245a}\label{classACG_1_1ShaderModifier_ad4990b509a8fe3bca25682a8fb0a245a}} 
std\+::vector$<$ unsigned int $>$ {\bfseries operator$\vert$} (const std\+::vector$<$ unsigned int $>$ \&\+\_\+v) const
\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{classACG_1_1ShaderModifier}{Shader\+Modifier} $\ast$ \hyperlink{classACG_1_1ShaderModifier_ad03f9f74a4c15b77b687b40b7c864992}{load\+From\+File} (Q\+String \+\_\+filename)
\begin{DoxyCompactList}\small\item\em Load a modifier from file. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classACG_1_1ShaderModifier_a9ec21472bf02d79539bda0aa734c3f65}\label{classACG_1_1ShaderModifier_a9ec21472bf02d79539bda0aa734c3f65}} 
unsigned int {\bfseries modifier\+I\+D\+\_\+}
\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classACG_1_1ShaderModifier_a2c432d20cb751ccdd461ee4594755dc6}\label{classACG_1_1ShaderModifier_a2c432d20cb751ccdd461ee4594755dc6}} 
class {\bfseries Shader\+Prog\+Generator}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
A shader modifier can modify uniforms, in/outputs and glsl code of vertex and fragment shaders. This is useful for global effects like shadow mapping and depth peeling, where only little changes in code are necessary.

Usage\+:
\begin{DoxyEnumerate}
\item Derive a new subclass of \hyperlink{classACG_1_1ShaderModifier}{Shader\+Modifier} and implement necessary modify functions.
\item Allocate a static instance of your modifier and register it to \hyperlink{classACG_1_1ShaderProgGenerator}{Shader\+Prog\+Generator} to get it\textquotesingle{}s modifier-\/\+ID
\item Create \hyperlink{classACG_1_1ShaderProgGenerator}{Shader\+Prog\+Generator} with a bitwise combination of modifier I\+Ds to activate them.
\end{DoxyEnumerate}

Example\+: 
\begin{DoxyCode}
\textcolor{comment}{// First modifier}
\textcolor{keyword}{class }VertexShaderModifier1 : \textcolor{keyword}{public} \hyperlink{classACG_1_1ShaderModifier}{ACG::ShaderModifier} \{
\textcolor{keyword}{public}:
  \textcolor{keywordtype}{void} \hyperlink{classACG_1_1ShaderModifier_a5f7d792c06eff3a8dda3656825db1691}{modifyVertexEndCode}(QStringList* \_code) \{
    \_code->push\_back(\textcolor{stringliteral}{"// Vertex End Code Modifier begin"});
    \_code->push\_back(\textcolor{stringliteral}{"< Some glsl code >  "});
    \_code->push\_back(\textcolor{stringliteral}{"// Vertex End Code Modifier end"});
  \}

  \textcolor{keyword}{static} VertexShaderModifier1 instance;
\};

\textcolor{comment}{// Static instance required!}
VertexShaderModifier YarnVertexShaderModifier::instance;


\textcolor{keyword}{class }VertexShaderModifier2 : \textcolor{keyword}{public} \hyperlink{classACG_1_1ShaderModifier}{ACG::ShaderModifier} \{
\textcolor{keyword}{public}:
  \textcolor{keywordtype}{void} \hyperlink{classACG_1_1ShaderModifier_a5f7d792c06eff3a8dda3656825db1691}{modifyVertexEndCode}(QStringList* \_code) \{
    \_code->push\_back(\textcolor{stringliteral}{"// Vertex End Code Modifier 2 begin"});
    \_code->push\_back(\textcolor{stringliteral}{"< Some glsl code >  "});
    \_code->push\_back(\textcolor{stringliteral}{"// Vertex End Code Modifier 2 end"});
  \}

  \textcolor{keyword}{static} VertexShaderModifier2 instance;
\};

VertexShaderModifier2 VertexShaderModifier2::instance;
\end{DoxyCode}


To use the modifiers, you have to register them to the shader generator\+: 
\begin{DoxyCode}
\textcolor{comment}{// Register the modifiers}
\hyperlink{classACG_1_1ShaderProgGenerator_a96b207003d2c540b0b676c0fa267a2ab}{ACG::ShaderProgGenerator::registerModifier}(&
      VertexShaderModifier::instance);
\hyperlink{classACG_1_1ShaderProgGenerator_a96b207003d2c540b0b676c0fa267a2ab}{ACG::ShaderProgGenerator::registerModifier}(&
      VertexShaderModifier2::instance);

\textcolor{comment}{// Use them via the shader cache}
\hyperlink{classGLSL_1_1Program}{GLSL::Program}* prog = \hyperlink{classACG_1_1ShaderCache_a25db1fcdf5081ab345e27732e0d07d56}{ACG::ShaderCache::getInstance}()->
      \hyperlink{classACG_1_1ShaderCache_af7e74e2c97dcea1fb3c482ea5d8560d0}{getProgram}(&shDesc,(VertexShaderModifier::instance.\hyperlink{classACG_1_1ShaderModifier_af0a569920d4cf8d1e080492862ddcabf}{getID}() | VertexShaderModifier2::instance
      .\hyperlink{classACG_1_1ShaderModifier_af0a569920d4cf8d1e080492862ddcabf}{getID}() ));
\end{DoxyCode}
 

Definition at line 969 of file Shader\+Generator.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{classACG_1_1ShaderModifier_af0a569920d4cf8d1e080492862ddcabf}\label{classACG_1_1ShaderModifier_af0a569920d4cf8d1e080492862ddcabf}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!get\+ID@{get\+ID}}
\index{get\+ID@{get\+ID}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{get\+I\+D()}{getID()}}
{\footnotesize\ttfamily unsigned int A\+C\+G\+::\+Shader\+Modifier\+::get\+ID (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Returns the modifier ID. 

\begin{DoxyReturn}{Returns}
Id of the modifier 
\end{DoxyReturn}


Definition at line 1132 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_ad03f9f74a4c15b77b687b40b7c864992}\label{classACG_1_1ShaderModifier_ad03f9f74a4c15b77b687b40b7c864992}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!load\+From\+File@{load\+From\+File}}
\index{load\+From\+File@{load\+From\+File}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{load\+From\+File()}{loadFromFile()}}
{\footnotesize\ttfamily \hyperlink{classACG_1_1ShaderModifier}{Shader\+Modifier} $\ast$ A\+C\+G\+::\+Shader\+Modifier\+::load\+From\+File (\begin{DoxyParamCaption}\item[{Q\+String}]{\+\_\+filename }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Load a modifier from file. 

Shader Mod text file format\+:

The file can begin with a glsl version directive (optionally)\+: \#version glsl\+\_\+version

The rest of the file contains glsl code blocks, which are separated by keywords. Each keyword must be at the beginning of a line. Furthermore they end on a colon \textquotesingle{}\+:\textquotesingle{}. The keyword defines the meaning of the following code block.

IO code blocks are specified by the keywords\+: Vertex\+IO\+:, Tess\+Control\+IO\+:, Tess\+Eval\+IO\+:, Geometry\+IO\+: and Fragment\+IO\+:

example

Vertex\+IO\+: in vec3 custom\+Input\+Name; out vec3 custum\+Output\+Name; uniform vec4 param0;

Shader code modifications are done via the keywords\+: Vertex\+Begin\+Code\+:, Vertex\+End\+Code\+:, Fragment\+Begin\+Code\+: and Fragment\+End\+Code\+:

The returned modifier should not be deleted manually.


\begin{DoxyParams}{Parameters}
{\em \+\_\+filename} & absolute or relative (from shaderdir) file name \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to shader modifier, 0 if loading failed 
\end{DoxyReturn}


Definition at line 2724 of file Shader\+Generator.\+cc.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a70fe99b722072abb212f210b75e11b4b}\label{classACG_1_1ShaderModifier_a70fe99b722072abb212f210b75e11b4b}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Fragment\+Begin\+Code@{modify\+Fragment\+Begin\+Code}}
\index{modify\+Fragment\+Begin\+Code@{modify\+Fragment\+Begin\+Code}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Fragment\+Begin\+Code()}{modifyFragmentBeginCode()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Fragment\+Begin\+Code (\begin{DoxyParamCaption}\item[{Q\+String\+List $\ast$}]{\+\_\+code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Append code the the fragment shader. 

Refer to the generation structure (\hyperlink{ShaderGenerator_page}{Shader Generator} ) to see where your code is added and which variables you can modify. Use


\begin{DoxyCode}
\_code->push\_back(\textcolor{stringliteral}{"..."});
\end{DoxyCode}


to insert your code here


\begin{DoxyParams}{Parameters}
{\em \+\_\+code} & string list of shader code. \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_a408ec2b79a8bb3ab28cc26fbad98bb02}{A\+C\+G\+::\+Shader\+Modifier\+File}, \hyperlink{classPeelDualLayerModifier_af2e9880ddf838a57035674ee9fd2cf00}{Peel\+Dual\+Layer\+Modifier}, and \hyperlink{classPeelLayerModifier_af45caec64259f9a4ab1c26c52f551d81}{Peel\+Layer\+Modifier}.



Definition at line 1085 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a25b1e0be6dd4a8365ecb1c72da21d310}\label{classACG_1_1ShaderModifier_a25b1e0be6dd4a8365ecb1c72da21d310}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Fragment\+End\+Code@{modify\+Fragment\+End\+Code}}
\index{modify\+Fragment\+End\+Code@{modify\+Fragment\+End\+Code}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Fragment\+End\+Code()}{modifyFragmentEndCode()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Fragment\+End\+Code (\begin{DoxyParamCaption}\item[{Q\+String\+List $\ast$}]{\+\_\+code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Append code the the fragment shader. 

Refer to the generation structure (\hyperlink{ShaderGenerator_page}{Shader Generator} ) to see where your code is added and which variables you can modify. Use


\begin{DoxyCode}
\_code->push\_back(\textcolor{stringliteral}{"..."});
\end{DoxyCode}


to insert your code here.


\begin{DoxyParams}{Parameters}
{\em \+\_\+code} & string list of shader code. \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_ab0d6bf678ebe2da837d89f1110bfdaf6}{A\+C\+G\+::\+Shader\+Modifier\+File}, \hyperlink{classACG_1_1IRenderer_1_1DepthMapPass_ac29e1f8e4a1112fbe375519d1bf69508}{A\+C\+G\+::\+I\+Renderer\+::\+Depth\+Map\+Pass}, \hyperlink{classPeelDualInitModifier_a1f8ff4872e6e5b1caf1dddbcd10924f8}{Peel\+Dual\+Init\+Modifier}, \hyperlink{classPeelDualLayerModifier_a10eea4a556f4dd572f88b404252a2066}{Peel\+Dual\+Layer\+Modifier}, \hyperlink{classPeelInitModifier_ad37b82ee9095d802ab3a449cc8e39d7d}{Peel\+Init\+Modifier}, \hyperlink{classCelShadingModifier_a81ad6e4358ff91486456dd2b687bf1c3}{Cel\+Shading\+Modifier}, \hyperlink{classPeelLayerModifier_a8bf411eaeda3051cd02acdd33e888aa9}{Peel\+Layer\+Modifier}, and \hyperlink{classNormalFragmentModifier_a0c228f43b14edc4bc6d41649f0164aac}{Normal\+Fragment\+Modifier}.



Definition at line 1101 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_ae720c7104306f1e696e690760b928048}\label{classACG_1_1ShaderModifier_ae720c7104306f1e696e690760b928048}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Fragment\+IO@{modify\+Fragment\+IO}}
\index{modify\+Fragment\+IO@{modify\+Fragment\+IO}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Fragment\+I\+O()}{modifyFragmentIO()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Fragment\+IO (\begin{DoxyParamCaption}\item[{\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$}]{\+\_\+shader }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Add your own inputs/outputs to the fragment shader. 

your implementation may look like this\+:


\begin{DoxyCode}
\_shader->addInput(\textcolor{stringliteral}{"sampler2D depthSampler"});
\_shader->addUniform(\textcolor{stringliteral}{"vec4 shaderParam"});
\end{DoxyCode}



\begin{DoxyParams}{Parameters}
{\em \+\_\+shader} & shader interface \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_ab2640975cfda9dab4bd4608204cbb151}{A\+C\+G\+::\+Shader\+Modifier\+File}, \hyperlink{classPeelDualLayerModifier_a33b6b1ae2d58336249113668ba290614}{Peel\+Dual\+Layer\+Modifier}, \hyperlink{classPeelInitModifier_af78f07838d5bdc7dffba95b29abade7d}{Peel\+Init\+Modifier}, \hyperlink{classCelShadingModifier_aa22486aa3db6eed67b581729ae55b798}{Cel\+Shading\+Modifier}, and \hyperlink{classPeelLayerModifier_a72be1c05b31ef4b3088fa8994aaa2608}{Peel\+Layer\+Modifier}.



Definition at line 1069 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a18ccb497e9e46b32a10824c9409c9666}\label{classACG_1_1ShaderModifier_a18ccb497e9e46b32a10824c9409c9666}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Geometry\+IO@{modify\+Geometry\+IO}}
\index{modify\+Geometry\+IO@{modify\+Geometry\+IO}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Geometry\+I\+O()}{modifyGeometryIO()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Geometry\+IO (\begin{DoxyParamCaption}\item[{\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$}]{\+\_\+shader }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Add your own inputs/outputs to the geometry shader. 

your implementation may look like this\+:


\begin{DoxyCode}
\_shader->addInput(\textcolor{stringliteral}{"sampler2D depthSampler"});
\_shader->addUniform(\textcolor{stringliteral}{"vec4 shaderParam"});
\end{DoxyCode}



\begin{DoxyParams}{Parameters}
{\em \+\_\+shader} & shader interface \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_a67aa376b99dabf7ce06891f9d0541034}{A\+C\+G\+::\+Shader\+Modifier\+File}.



Definition at line 1030 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a0d9329675647a8d2d7c9ebd66370a30b}\label{classACG_1_1ShaderModifier_a0d9329675647a8d2d7c9ebd66370a30b}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Lighting\+Code@{modify\+Lighting\+Code}}
\index{modify\+Lighting\+Code@{modify\+Lighting\+Code}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Lighting\+Code()}{modifyLightingCode()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Lighting\+Code (\begin{DoxyParamCaption}\item[{Q\+String\+List $\ast$}]{\+\_\+code,  }\item[{int}]{\+\_\+light\+Id,  }\item[{Shader\+Gen\+Light\+Type}]{\+\_\+light\+Type }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Modify the default lighting code of the shader generator. 

Refer to the generation structure (\hyperlink{ShaderGenerator_page}{Shader Generator} ) to see where your code is added and which variables you can modify.

Use


\begin{DoxyCode}
\_code->push\_back(\textcolor{stringliteral}{"..."});
\end{DoxyCode}


to insert your code here.


\begin{DoxyParams}{Parameters}
{\em \+\_\+code} & string list of shader code. \\
\hline
{\em \+\_\+light\+Id} & light index, use g\+\_\+v\+Light\+Dir\+\_\+\+\_\+\{\+\_\+light\+Id\}, etc. in shader code to use light parameters \\
\hline
{\em \+\_\+light\+Type} & light type\+: point, spot or directional light \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classCelShadingModifier_a55899bf3273f452cc4150666aba57c62}{Cel\+Shading\+Modifier}.



Definition at line 1120 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a5258b3fadeb7e34345aabe87aaa5479c}\label{classACG_1_1ShaderModifier_a5258b3fadeb7e34345aabe87aaa5479c}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Tess\+Control\+IO@{modify\+Tess\+Control\+IO}}
\index{modify\+Tess\+Control\+IO@{modify\+Tess\+Control\+IO}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Tess\+Control\+I\+O()}{modifyTessControlIO()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Tess\+Control\+IO (\begin{DoxyParamCaption}\item[{\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$}]{\+\_\+shader }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Add your own inputs/outputs to the tessellation control shader. 

your implementation may look like this\+:


\begin{DoxyCode}
\_shader->addInput(\textcolor{stringliteral}{"sampler2D depthSampler"});
\_shader->addUniform(\textcolor{stringliteral}{"vec4 shaderParam"});
\end{DoxyCode}



\begin{DoxyParams}{Parameters}
{\em \+\_\+shader} & shader interface \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_ae4e73507f71ee7f5d974f79ca88f5529}{A\+C\+G\+::\+Shader\+Modifier\+File}.



Definition at line 1043 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a4bf90e17e6b02ae7d9fdffc96a890e07}\label{classACG_1_1ShaderModifier_a4bf90e17e6b02ae7d9fdffc96a890e07}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Tess\+Eval\+IO@{modify\+Tess\+Eval\+IO}}
\index{modify\+Tess\+Eval\+IO@{modify\+Tess\+Eval\+IO}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Tess\+Eval\+I\+O()}{modifyTessEvalIO()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Tess\+Eval\+IO (\begin{DoxyParamCaption}\item[{\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$}]{\+\_\+shader }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Add your own inputs/outputs to the tessellation evaluation shader. 

your implementation may look like this\+:


\begin{DoxyCode}
\_shader->addInput(\textcolor{stringliteral}{"sampler2D depthSampler"});
\_shader->addUniform(\textcolor{stringliteral}{"vec4 shaderParam"});
\end{DoxyCode}



\begin{DoxyParams}{Parameters}
{\em \+\_\+shader} & shader interface \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_a31407e8f2583f7dd00f2ccdf14a318ad}{A\+C\+G\+::\+Shader\+Modifier\+File}.



Definition at line 1056 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a501dd2d58dd6427bc91e39d89c94b94e}\label{classACG_1_1ShaderModifier_a501dd2d58dd6427bc91e39d89c94b94e}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Vertex\+Begin\+Code@{modify\+Vertex\+Begin\+Code}}
\index{modify\+Vertex\+Begin\+Code@{modify\+Vertex\+Begin\+Code}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Vertex\+Begin\+Code()}{modifyVertexBeginCode()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Vertex\+Begin\+Code (\begin{DoxyParamCaption}\item[{Q\+String\+List $\ast$}]{\+\_\+code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Append code the the vertex shader. 

Refer to the generation structure (\hyperlink{ShaderGenerator_page}{Shader Generator} ) to see where your code is added and which variables you can modify. Use 
\begin{DoxyCode}
\_code->push\_back(\textcolor{stringliteral}{"..."});
\end{DoxyCode}
 to insert your code here.


\begin{DoxyParams}{Parameters}
{\em \+\_\+code} & string list of shader code. \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_ab8c8036a65dfa6074eadecd304b65ecb}{A\+C\+G\+::\+Shader\+Modifier\+File}.



Definition at line 1002 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a5f7d792c06eff3a8dda3656825db1691}\label{classACG_1_1ShaderModifier_a5f7d792c06eff3a8dda3656825db1691}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Vertex\+End\+Code@{modify\+Vertex\+End\+Code}}
\index{modify\+Vertex\+End\+Code@{modify\+Vertex\+End\+Code}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Vertex\+End\+Code()}{modifyVertexEndCode()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Vertex\+End\+Code (\begin{DoxyParamCaption}\item[{Q\+String\+List $\ast$}]{\+\_\+code }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Append code the the vertex shader. 

Refer to the generation structure (\hyperlink{ShaderGenerator_page}{Shader Generator} ) to see where your code is added and which variables you can modify. Use


\begin{DoxyCode}
\_code->push\_back(\textcolor{stringliteral}{"..."});
\end{DoxyCode}
 to insert your code here


\begin{DoxyParams}{Parameters}
{\em \+\_\+code} & string list of shader code. \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_a6e8c1df9d191cba2b6afb9ca777dbe38}{A\+C\+G\+::\+Shader\+Modifier\+File}, and \hyperlink{classACG_1_1SceneGraph_1_1ClippingNode_1_1ClippingShaderModifier_aa66af9e349d08f7e6138e18e4ecbdd44}{A\+C\+G\+::\+Scene\+Graph\+::\+Clipping\+Node\+::\+Clipping\+Shader\+Modifier}.



Definition at line 1017 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a0692498de2b752b70b8ac3afcbfb5212}\label{classACG_1_1ShaderModifier_a0692498de2b752b70b8ac3afcbfb5212}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Vertex\+IO@{modify\+Vertex\+IO}}
\index{modify\+Vertex\+IO@{modify\+Vertex\+IO}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{modify\+Vertex\+I\+O()}{modifyVertexIO()}}
{\footnotesize\ttfamily virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Vertex\+IO (\begin{DoxyParamCaption}\item[{\hyperlink{classACG_1_1ShaderGenerator}{Shader\+Generator} $\ast$}]{\+\_\+shader }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Add your own inputs/outputs to the vertex shader. 

Your implementation may look like this\+:


\begin{DoxyCode}
\_shader->addInput(\textcolor{stringliteral}{"vec4 inTangent"});
\_shader->addUniform(\textcolor{stringliteral}{"vec4 shaderParam"});
\end{DoxyCode}



\begin{DoxyParams}{Parameters}
{\em \+\_\+shader} & shader interface \\
\hline
\end{DoxyParams}


Reimplemented in \hyperlink{classACG_1_1ShaderModifierFile_a88fa99947d0ed32259eac641943f7387}{A\+C\+G\+::\+Shader\+Modifier\+File}, \hyperlink{classACG_1_1SceneGraph_1_1ClippingNode_1_1ClippingShaderModifier_a9bd4815ec74a2844c3ff2479481fcd6a}{A\+C\+G\+::\+Scene\+Graph\+::\+Clipping\+Node\+::\+Clipping\+Shader\+Modifier}, \hyperlink{classCelShadingModifier_afeb08b63efc70cff2fd31da965956d5e}{Cel\+Shading\+Modifier}, and \hyperlink{classNormalFragmentModifier_a6bfe2475dc55e89b72b8fda7144aa5ae}{Normal\+Fragment\+Modifier}.



Definition at line 988 of file Shader\+Generator.\+hh.

\mbox{\Hypertarget{classACG_1_1ShaderModifier_a62cbca887ccde2f2953b8253886d47ee}\label{classACG_1_1ShaderModifier_a62cbca887ccde2f2953b8253886d47ee}} 
\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!replace\+Default\+Lighting\+Code@{replace\+Default\+Lighting\+Code}}
\index{replace\+Default\+Lighting\+Code@{replace\+Default\+Lighting\+Code}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection{\texorpdfstring{replace\+Default\+Lighting\+Code()}{replaceDefaultLightingCode()}}
{\footnotesize\ttfamily virtual bool A\+C\+G\+::\+Shader\+Modifier\+::replace\+Default\+Lighting\+Code (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Specify whether this modifier replaces or extends the default lighting code. 

\begin{DoxyReturn}{Returns}
return false if this modifier modifies an already computed lighting color, return true if this modifier replaces the default lighting color 
\end{DoxyReturn}


Reimplemented in \hyperlink{classCelShadingModifier_a7ab6159c2138c3da3e143e85acb67110}{Cel\+Shading\+Modifier}.



Definition at line 1126 of file Shader\+Generator.\+hh.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
Open\+Flipper/libs\+\_\+required/\+A\+C\+G/\+G\+L/Shader\+Generator.\+hh\item 
Open\+Flipper/libs\+\_\+required/\+A\+C\+G/\+G\+L/Shader\+Generator.\+cc\end{DoxyCompactItemize}
