Untitled - Departamento de Ciencias e Ingeniería de la Computación
Untitled - Departamento de Ciencias e Ingeniería de la Computación
Untitled - Departamento de Ciencias e Ingeniería de la Computación
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
float SpotLightCone <<br />
string UIWidget = "sli<strong>de</strong>r";<br />
float UIMin = 0.0;<br />
float UIMax = 90.5;<br />
float UIStep = 0.1;<br />
string UIName = "Spot Cone Angle";<br />
> = 60.0;<br />
float3 SpotLightColor : Specu<strong>la</strong>r <<br />
string UIName = "Spot Light Color";<br />
string Object = "SpotLight";<br />
string UIWidget = "Color";<br />
> = {0.0f, 0.0f, 0.0f};<br />
float SpotLightIntensity <<br />
string UIName = "Spot Intensity";<br />
string UIWidget = "sli<strong>de</strong>r";<br />
float UIMin = 0.0;<br />
float UIMax = 2;<br />
float UIStep = 0.1;<br />
> = 2;<br />
Definimos <strong>la</strong>s variables globales concernientes a <strong>la</strong>s luces. En este caso, nuestro sha<strong>de</strong>r utilizará cuatro luces, cada<br />
una <strong>de</strong> distinto tipo:<br />
Ambiente.<br />
Punto.<br />
Direccional.<br />
Spot.<br />
Análogamente, tomemos una variable global <strong>de</strong> ejemplo, el color <strong>de</strong> <strong>la</strong> luz ambiente:<br />
// Ambient light //<br />
(1) float3 AmbientLightColor : (2) SPECULAR <<br />
(3) string UIName = "Ambient Light Color";<br />
string UIWidget = "Color";<br />
> = (4) {0.05f, 0.05f, 0.05f};<br />
(1) Definimos al color <strong>de</strong> <strong>la</strong> luz ambiente como un vector <strong>de</strong> tres componentes <strong>de</strong> punto flotante.<br />
(2) Definimos su semántica, <strong>la</strong> cual le indica al FX Composer que <strong>la</strong> variable representa a un color especu<strong>la</strong>r. En<br />
este caso, a diferencia <strong>de</strong>l anterior, FX Composer cargará el valor <strong>de</strong> <strong>la</strong> variable con lo establecido en (4), <strong>la</strong><br />
asignación inicial <strong>de</strong> <strong>la</strong> variable.<br />
(3) Luego, <strong>de</strong>finimos <strong>la</strong> anotación. Le indicamos que <strong>la</strong> variable tendrá un control gráfico asociado en el editor<br />
gráfico <strong>de</strong> propieda<strong>de</strong>s <strong>de</strong>l sha<strong>de</strong>r. Este control se l<strong>la</strong>mará “Ambient Light Color” y permitirá modificar el<br />
valor utilizando una herramienta <strong>de</strong> selección <strong>de</strong> color.<br />
(4) Por último, especificamos el valor inicial <strong>de</strong> <strong>la</strong> variable. En este caso, <strong>la</strong> variable tendrá un color gris muy<br />
oscuro. El valor inicial <strong>de</strong> <strong>la</strong> variable tiene más sentido para el FX Composer que para <strong>la</strong> aplicación principal,<br />
dado que esta ultima suele asignarle el valor <strong>de</strong> <strong>la</strong> misma.<br />
Superficie<br />
//////////////////////////////////////////////<br />
/////////////// Superficie ///////////////////<br />
//////////////////////////////////////////////<br />
float AlphaBlending<br />
<<br />
string UIWidget = "sli<strong>de</strong>r";<br />
float UIMin = 0.0;<br />
Página 73