I have followed various forum for to document me and I have tried.
I now want to ask you, it is normal that if I go near too much me to the wall (I speak of a bsp)
do the bricks that are in relief have an effect soft pudding
If then I put the vision in third person, rotating the camera to the right-left, the tiles follow
the camera instead of being verse the normal of the wall!
What am I being wrong, or thing I have not understood?
Thanks!
vertex program:
!!ARBvp1.0
#================================================================
# shader_BOFFG_vp.s - Diffuse+Bump+Height+Gloss+Specular
#================================================================
# Copyright (C) 2005 - Frank Mikero.
# aka Typhontaur.
#================================================================
# This program is free software. You can redistribute it and/or
# modify it under the terms of the GNU General Public License.
# See the GNU General Public License for more details. You
# should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software:
# Foundation, Inc.59 Temple Place Suite 330,Boston,MA 02111-1307,
# USA.
#================================================================
OPTION ARB_position_invariant;
#===============================================
OUTPUT output = result.color;
#===============================================
ATTRIB attr_TexCoord0 = vertex.attrib[8];
ATTRIB attr_VertexPos = vertex.position;
ATTRIB attr_Tangent = vertex.attrib[6];
ATTRIB attr_Binormal = vertex.attrib[7];
ATTRIB attr_Normal = vertex.normal;
#===============================================
PARAM u_view_origin = program.env[0];
PARAM u_light_origin = program.env[1];
#===============================================
OUTPUT var_texCoord = result.texcoord[1];
OUTPUT var_lightVec = result.texcoord[2];
OUTPUT var_viewVec = result.texcoord[3];
#===============================================
PARAM texMatrix[4] = { state.matrix.texture[0] };
#===============================================
TEMP lightVec, viewVec;
#===============================================
# ASSEMBLY CODE
#===============================================
DP4 var_texCoord.x, texMatrix[0], attr_TexCoord0;
DP4 var_texCoord.y, texMatrix[1], attr_TexCoord0;
DP4 var_texCoord.z, texMatrix[2], attr_TexCoord0;
DP4 var_texCoord.w, texMatrix[3], attr_TexCoord0;
SUB lightVec.xyz, u_light_origin, attr_VertexPos;
SUB viewVec.xyz, u_view_origin, attr_VertexPos;
DP3 var_lightVec.x, attr_Tangent, lightVec;
DP3 var_lightVec.y, attr_Binormal, lightVec;
DP3 var_lightVec.z, attr_Normal, lightVec;
DP3 var_viewVec.x, attr_Tangent, viewVec;
DP3 var_viewVec.y, attr_Binormal, viewVec;
DP3 var_viewVec.z, attr_Normal, viewVec;
MOV output, vertex.color;
#===============================================
END # end of program
#===============================================
fragment program:
!!ARBfp1.0
#================================================================
# shader_BOFFG_fp.s - Diffuse+Bump+Height+Gloss+Specular
#================================================================
# Copyright (C) 2005 - Frank Mikero.
# aka Typhontaur.
#================================================================
# This program is free software. You can redistribute it and/or
# modify it under the terms of the GNU General Public License.
# See the GNU General Public License for more details. You
# should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software:
# Foundation, Inc.59 Temple Place Suite 330,Boston,MA 02111-1307,
# USA.
#================================================================
OPTION ARB_precision_hint_fastest;
#OPTION ARB_precision_hint_nicest;
#===============================================
OUTPUT output = result.color;
TEMP base, bump, gloss, lVect, viewV, atten;
TEMP diffuse, specular, temp, invLen;
TEMP height, newtexcoord;
#===============================================
PARAM u_specular_exponent = program.env[6];
PARAM u_specular_scale = program.env[7];
PARAM u_ambient = program.env[15];
PARAM u_attparams = program.local[0];
#===============================================
PARAM m_one = {-1.0, -1.0, -1.0, -1.0 };
PARAM two = { 2.0, 2.0, 2.0, 2.0 };
#===============================================
ATTRIB var_texCoord = fragment.texcoord[1];
ATTRIB var_lightVec = fragment.texcoord[2];
ATTRIB var_viewVec = fragment.texcoord[3];
#===============================================
# ASSEMBLY CODE
#===============================================
#===============================================
# Normalize view vector
#===============================================
DP3 temp, var_viewVec, var_viewVec;
RSQ invLen, temp.x;
MUL viewV, var_viewVec, invLen;
TEX height, var_texCoord, texture[2], 2D;
MAD height, height, 0.04, -0.02; # scale and bias
MAD newtexcoord, height, viewV, var_texCoord;
TEX base, newtexcoord, texture[0], 2D;
TEX bump, newtexcoord, texture[1], 2D;
TEX gloss, newtexcoord, texture[3], 2D;
#===============================================
# Scale and bias
#===============================================
MAD bump, bump, two, m_one;
#===============================================
# Post-filter normalisation of bumpmap
#===============================================
DP3 temp, bump, bump;
RSQ invLen, temp.x;
MUL bump, bump, invLen;
#===============================================
# Normalize light vector
#===============================================
DP3 temp, var_lightVec, var_lightVec;
RSQ invLen, temp.x;
MUL lVect, var_lightVec, invLen;
#===============================================
# Attenuation
#===============================================
DST atten, temp, invLen;
DP3 atten, atten, u_attparams;
RCP atten, atten.x;
#===============================================
# Diffuse
#===============================================
DP3_SAT diffuse, lVect, bump;
#===============================================
# Reflection vector
#===============================================
DP3 temp, lVect, bump;
MUL temp, temp, two;
MUL temp, temp, bump;
SUB lVect, temp, lVect;
#===============================================
# Specular
#===============================================
DP3_SAT specular, lVect, viewV;
#===============================================
# Specular ^ specExp
#===============================================
LG2 temp, specular.x;
MUL temp, temp, u_specular_exponent;
EX2 specular, temp.x;
MUL specular, specular, gloss;
#===============================================
# Ambient*Base+(Diffuse*Base+u_specular_scale*
# Specular) * Attenuation
#===============================================
MUL temp, specular, u_specular_scale;
MAD diffuse, diffuse, base, temp;
MUL temp, base, u_ambient;
MAD output, diffuse, atten, temp;
#===============================================
END # end of program
#===============================================


:blush:


















