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


{\ttfamily \#include $<$A\+C\+G/\+G\+L/\+Shader\+Generator.\+hh$>$}

Inheritance diagram for A\+C\+G\+:\+:Shader\+Modifier\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=9.000000cm]{a01163}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{a01163_a0692498de2b752b70b8ac3afcbfb5212}{modify\+Vertex\+I\+O} (\hyperlink{a01160}{Shader\+Generator} $\ast$\+\_\+shader)
\begin{DoxyCompactList}\small\item\em Add your own inputs/outputs to the vertex shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{a01163_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{a01163_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{a01163_a18ccb497e9e46b32a10824c9409c9666}{modify\+Geometry\+I\+O} (\hyperlink{a01160}{Shader\+Generator} $\ast$\+\_\+shader)
\begin{DoxyCompactList}\small\item\em Add your own inputs/outputs to the geometry shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{a01163_a5258b3fadeb7e34345aabe87aaa5479c}{modify\+Tess\+Control\+I\+O} (\hyperlink{a01160}{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{a01163_a4bf90e17e6b02ae7d9fdffc96a890e07}{modify\+Tess\+Eval\+I\+O} (\hyperlink{a01160}{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{a01163_ae720c7104306f1e696e690760b928048}{modify\+Fragment\+I\+O} (\hyperlink{a01160}{Shader\+Generator} $\ast$\+\_\+shader)
\begin{DoxyCompactList}\small\item\em Add your own inputs/outputs to the fragment shader. \end{DoxyCompactList}\item 
virtual void \hyperlink{a01163_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{a01163_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{a01163_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{a01163_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{a01163_af0a569920d4cf8d1e080492862ddcabf}{get\+I\+D} ()
\begin{DoxyCompactList}\small\item\em Returns the modifier I\+D. \end{DoxyCompactList}\item 
\hypertarget{a01163_a278b6fa2fc3c8bac206b44c82a48a2e8}{{\bfseries operator std\+::vector$<$ unsigned int $>$} () const }\label{a01163_a278b6fa2fc3c8bac206b44c82a48a2e8}

\item 
\hypertarget{a01163_ae056b47f1c73c32af047a6ed31a3672b}{std\+::vector$<$ unsigned int $>$ {\bfseries operator$\vert$} (const std\+::vector$<$ unsigned int $>$ \&\+\_\+v) const }\label{a01163_ae056b47f1c73c32af047a6ed31a3672b}

\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{a01163}{Shader\+Modifier} $\ast$ \hyperlink{a01163_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 
\hypertarget{a01163_a9ec21472bf02d79539bda0aa734c3f65}{unsigned int {\bfseries modifier\+I\+D\+\_\+}}\label{a01163_a9ec21472bf02d79539bda0aa734c3f65}

\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a01163_a2c432d20cb751ccdd461ee4594755dc6}{class {\bfseries Shader\+Prog\+Generator}}\label{a01163_a2c432d20cb751ccdd461ee4594755dc6}

\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{a01163}{Shader\+Modifier} and implement necessary modify functions.
\item Allocate a static instance of your modifier and register it to \hyperlink{a01168}{Shader\+Prog\+Generator} to get it's modifier-\/\+I\+D
\item Create \hyperlink{a01168}{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{a01163}{ACG::ShaderModifier} \{
\textcolor{keyword}{public}:
  \textcolor{keywordtype}{void} \hyperlink{a01163_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{a01163}{ACG::ShaderModifier} \{
\textcolor{keyword}{public}:
  \textcolor{keywordtype}{void} \hyperlink{a01163_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{a01168_a96b207003d2c540b0b676c0fa267a2ab}{ACG::ShaderProgGenerator::registerModifier}(&
      VertexShaderModifier::instance);
\hyperlink{a01168_a96b207003d2c540b0b676c0fa267a2ab}{ACG::ShaderProgGenerator::registerModifier}(&
      VertexShaderModifier2::instance);

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

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



\subsection{Member Function Documentation}
\hypertarget{a01163_af0a569920d4cf8d1e080492862ddcabf}{\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!get\+I\+D@{get\+I\+D}}
\index{get\+I\+D@{get\+I\+D}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection[{get\+I\+D}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int A\+C\+G\+::\+Shader\+Modifier\+::get\+I\+D (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{a01163_af0a569920d4cf8d1e080492862ddcabf}


Returns the modifier I\+D. 

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


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

\hypertarget{a01163_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[{load\+From\+File}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Shader\+Modifier} $\ast$ A\+C\+G\+::\+Shader\+Modifier\+::load\+From\+File (
\begin{DoxyParamCaption}
\item[{Q\+String}]{\+\_\+filename}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{a01163_ad03f9f74a4c15b77b687b40b7c864992}


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 '\+:'. The keyword defines the meaning of the following code block.

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

example

Vertex\+I\+O\+: 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 2679 of file Shader\+Generator.\+cc.

\hypertarget{a01163_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[{modify\+Fragment\+Begin\+Code}]{\setlength{\rightskip}{0pt plus 5cm}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]}}}\label{a01163_a70fe99b722072abb212f210b75e11b4b}


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{a01165_add200998400c987dd92e4a7ef85c34eb}{A\+C\+G\+::\+Shader\+Modifier\+File}, \hyperlink{a00950_af2e9880ddf838a57035674ee9fd2cf00}{Peel\+Dual\+Layer\+Modifier}, and \hyperlink{a00952_af45caec64259f9a4ab1c26c52f551d81}{Peel\+Layer\+Modifier}.



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

\hypertarget{a01163_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[{modify\+Fragment\+End\+Code}]{\setlength{\rightskip}{0pt plus 5cm}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]}}}\label{a01163_a25b1e0be6dd4a8365ecb1c72da21d310}


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{a01165_a527fe83a0d4737fe0f70809149922a64}{A\+C\+G\+::\+Shader\+Modifier\+File}, \hyperlink{a00494_ac29e1f8e4a1112fbe375519d1bf69508}{A\+C\+G\+::\+I\+Renderer\+::\+Depth\+Map\+Pass}, \hyperlink{a00949_a1f8ff4872e6e5b1caf1dddbcd10924f8}{Peel\+Dual\+Init\+Modifier}, \hyperlink{a00950_a10eea4a556f4dd572f88b404252a2066}{Peel\+Dual\+Layer\+Modifier}, \hyperlink{a00951_ad37b82ee9095d802ab3a449cc8e39d7d}{Peel\+Init\+Modifier}, \hyperlink{a00400_a81ad6e4358ff91486456dd2b687bf1c3}{Cel\+Shading\+Modifier}, \hyperlink{a00952_a8bf411eaeda3051cd02acdd33e888aa9}{Peel\+Layer\+Modifier}, and \hyperlink{a00887_a0c228f43b14edc4bc6d41649f0164aac}{Normal\+Fragment\+Modifier}.



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

\hypertarget{a01163_ae720c7104306f1e696e690760b928048}{\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Fragment\+I\+O@{modify\+Fragment\+I\+O}}
\index{modify\+Fragment\+I\+O@{modify\+Fragment\+I\+O}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection[{modify\+Fragment\+I\+O}]{\setlength{\rightskip}{0pt plus 5cm}virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Fragment\+I\+O (
\begin{DoxyParamCaption}
\item[{{\bf Shader\+Generator} $\ast$}]{\+\_\+shader}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01163_ae720c7104306f1e696e690760b928048}


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{a01165_adc1e1f9267d357bf62dce59b51030490}{A\+C\+G\+::\+Shader\+Modifier\+File}, \hyperlink{a00950_a33b6b1ae2d58336249113668ba290614}{Peel\+Dual\+Layer\+Modifier}, \hyperlink{a00951_af78f07838d5bdc7dffba95b29abade7d}{Peel\+Init\+Modifier}, \hyperlink{a00400_aa22486aa3db6eed67b581729ae55b798}{Cel\+Shading\+Modifier}, and \hyperlink{a00952_a72be1c05b31ef4b3088fa8994aaa2608}{Peel\+Layer\+Modifier}.



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

\hypertarget{a01163_a18ccb497e9e46b32a10824c9409c9666}{\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Geometry\+I\+O@{modify\+Geometry\+I\+O}}
\index{modify\+Geometry\+I\+O@{modify\+Geometry\+I\+O}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection[{modify\+Geometry\+I\+O}]{\setlength{\rightskip}{0pt plus 5cm}virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Geometry\+I\+O (
\begin{DoxyParamCaption}
\item[{{\bf Shader\+Generator} $\ast$}]{\+\_\+shader}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01163_a18ccb497e9e46b32a10824c9409c9666}


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{a01165_a0feda1c48cdda26ab4aedf931498a8e3}{A\+C\+G\+::\+Shader\+Modifier\+File}.



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

\hypertarget{a01163_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[{modify\+Lighting\+Code}]{\setlength{\rightskip}{0pt plus 5cm}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]}}}\label{a01163_a0d9329675647a8d2d7c9ebd66370a30b}


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{a00400_a55899bf3273f452cc4150666aba57c62}{Cel\+Shading\+Modifier}.



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

\hypertarget{a01163_a5258b3fadeb7e34345aabe87aaa5479c}{\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Tess\+Control\+I\+O@{modify\+Tess\+Control\+I\+O}}
\index{modify\+Tess\+Control\+I\+O@{modify\+Tess\+Control\+I\+O}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection[{modify\+Tess\+Control\+I\+O}]{\setlength{\rightskip}{0pt plus 5cm}virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Tess\+Control\+I\+O (
\begin{DoxyParamCaption}
\item[{{\bf Shader\+Generator} $\ast$}]{\+\_\+shader}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01163_a5258b3fadeb7e34345aabe87aaa5479c}


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{a01165_abaf389f03e0d93a05c047dfa1374a82d}{A\+C\+G\+::\+Shader\+Modifier\+File}.



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

\hypertarget{a01163_a4bf90e17e6b02ae7d9fdffc96a890e07}{\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Tess\+Eval\+I\+O@{modify\+Tess\+Eval\+I\+O}}
\index{modify\+Tess\+Eval\+I\+O@{modify\+Tess\+Eval\+I\+O}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection[{modify\+Tess\+Eval\+I\+O}]{\setlength{\rightskip}{0pt plus 5cm}virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Tess\+Eval\+I\+O (
\begin{DoxyParamCaption}
\item[{{\bf Shader\+Generator} $\ast$}]{\+\_\+shader}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01163_a4bf90e17e6b02ae7d9fdffc96a890e07}


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{a01165_a6c93242b747ff60aa7155ef091994f88}{A\+C\+G\+::\+Shader\+Modifier\+File}.



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

\hypertarget{a01163_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[{modify\+Vertex\+Begin\+Code}]{\setlength{\rightskip}{0pt plus 5cm}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]}}}\label{a01163_a501dd2d58dd6427bc91e39d89c94b94e}


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{a01165_ac959d207bd23ecdb252887b54aa5111c}{A\+C\+G\+::\+Shader\+Modifier\+File}.



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

\hypertarget{a01163_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[{modify\+Vertex\+End\+Code}]{\setlength{\rightskip}{0pt plus 5cm}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]}}}\label{a01163_a5f7d792c06eff3a8dda3656825db1691}


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{a01165_a0bd734e571045e10426f5657a01dff09}{A\+C\+G\+::\+Shader\+Modifier\+File}.



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

\hypertarget{a01163_a0692498de2b752b70b8ac3afcbfb5212}{\index{A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}!modify\+Vertex\+I\+O@{modify\+Vertex\+I\+O}}
\index{modify\+Vertex\+I\+O@{modify\+Vertex\+I\+O}!A\+C\+G\+::\+Shader\+Modifier@{A\+C\+G\+::\+Shader\+Modifier}}
\subsubsection[{modify\+Vertex\+I\+O}]{\setlength{\rightskip}{0pt plus 5cm}virtual void A\+C\+G\+::\+Shader\+Modifier\+::modify\+Vertex\+I\+O (
\begin{DoxyParamCaption}
\item[{{\bf Shader\+Generator} $\ast$}]{\+\_\+shader}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01163_a0692498de2b752b70b8ac3afcbfb5212}


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{a01165_ac07111d99ecb297d0472d3903819716d}{A\+C\+G\+::\+Shader\+Modifier\+File}, \hyperlink{a00400_afeb08b63efc70cff2fd31da965956d5e}{Cel\+Shading\+Modifier}, and \hyperlink{a00887_a6bfe2475dc55e89b72b8fda7144aa5ae}{Normal\+Fragment\+Modifier}.



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

\hypertarget{a01163_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[{replace\+Default\+Lighting\+Code}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool A\+C\+G\+::\+Shader\+Modifier\+::replace\+Default\+Lighting\+Code (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01163_a62cbca887ccde2f2953b8253886d47ee}


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{a00400_a7ab6159c2138c3da3e143e85acb67110}{Cel\+Shading\+Modifier}.



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



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