Hi. The code below is part of the translation for the model_common vertex shader (only the section on wind is not yet translated). We are relatively new to ARB shader language and so we are hoping to get some feedback on whether we are on the right track. While translating, we noticed some uniform variables (e.g. shadowScale, windData) that were used in the shader which needs to be called in the vertex shader, but we were not able to find the location where these variables were set (to get the index into program.local). So, where are the following variables set: cameraPos, sunDir, sunColor, losTransform, shadowTransform, instancingTransform, shadowScale, sim_time, windData ? !!ARBvp1.0 PARAM cameraPos = program.local[0]; PARAM sunDir = program.local[1]; PARAM sunColor = program.local[2]; PARAM losTransform = program.local[3]; PARAM shadowTransform[4] = { program.local[4..7] }; PARAM instancingTransform[4] = { program.local[8..11] }; #if USE_SHADOW_SAMPLER && USE_SHADOW_PCF PARAM shadowScale = program.local[12]; #endif #if USE_WIND PARAM sim_time = program.local[13]; PARAM windData = program.local[14]; #endif OUTPUT v_lighting; OUTPUT v_tex = result.texcoord[0]; OUTPUT v_los = result.texcoord[1]; #if USE_SHADOW OUTPUT v_shadow = result.texcoord[2]; #endif #if USE_INSTANCING && USE_AO OUTPUT v_tex2 = result.texcoord[3]; #endif #if USE_SPECULAR || USE_NORMAL_MAP || USE_SPECULAR_MAP || USE_PARALLAX_MAP OUTPUT v_normal = result.texcoord[4]; #if USE_INSTANCING && (USE_NORMAL_MAP || USE_PARALLAX_MAP) OUTPUT v_tangent = result.texcoord[4]; #endif #if USE_SPECULAR || USE_SPECULAR_MAP OUTPUT v_half = result.texcoord[5]; #endif #if USE_INSTANCING && USE_PARALLAX_MAP OUTPUT v_eyeVec = result.texcoord[6]; #endif #endif //// Compute position and normal: #if USE_INSTANCING TEMP position; TEMP normal; DP4 position.x, instancingTransform[0], vertex.position; DP4 position.y, instancingTransform[1], vertex.position; DP4 position.z, instancingTransform[2], vertex.position; MOV position.w, 1.0; DP3 normal.x, instancingTransform[0], vertex.normal; DP3 normal.y, instancingTransform[1], vertex.normal; DP3 normal.z, instancingTransform[2], vertex.normal; #if (USE_NORMAL_MAP || USE_PARALLAX_MAP) DP3 tangent.x, instancingTransform[0], vertex.tangent; DP3 tangent.y, instancingTransform[1], vertex.tangent; DP3 tangent.z, instancingTransform[2], vertex.tangent; #endif #else ATTRIB position = vertex.position; ATTRIB normal = vertex.normal; #endif #if USE_WIND TEMP wind; MOV wind, windData.xy; // ... #endif DP4 result.position.x, state.matrix.mvp.row[0], position; DP4 result.position.y, state.matrix.mvp.row[1], position; DP4 result.position.z, state.matrix.mvp.row[2], position; DP4 result.position.w, state.matrix.mvp.row[3], position; //// Compute lighting: #if USE_SPECULAR || USE_NORMAL_MAP || USE_SPECULAR_MAP || USE_PARALLAX_MAP MOV v_normal, normal; #if USE_INSTANCING && (USE_NORMAL_MAP || USE_PARALLAX_MAP) MOV v_tangent, tangent; TEMP normalXtangent; XPD normalXtangent, v_normal.xyz, v_tangent.xyz; TEMP bitangent; MOV bitangent, normalXtangent, a_tangent.w; MOV v_normal.w, bitangent.x; MOV v_tangent.w, bitangent.y; MOV v_lighting.w, bitangent.z; #endif #if USE_SPECULAR || USE_SPECULAR_MAP || USE_PARALLAX_MAP // eyeVec = cameraPos.xyz - position.xyz; TEMP eyeVec; SUB eyeVec.xyz, cameraPos, position; #if USE_SPECULAR || USE_SPECULAR_MAP // v_half = normalize(-sunDir + eyeVec); TEMP half; SUB half.xyz, eyeVec, sunDir; DP3 half.w, half, half; RSQ half.w, half.w; MUL v_half.xyz, half, half.w; #endif #if USE_INSTANCING && USE_PARALLAX_MAP MOV v_eyeVec, eyeVec; #endif #endif #endif // v_lighting.xyz = max(0.0, dot(normal, -sunDir)) * sunColor; DP3 lighting, normal, -sunDir; MAX lighting, 0.0, lighting; MUL result.color, lighting, sunColor; //// Texture coordinates: MOV v_tex, vertex.texcoord[0]; #if USE_INSTANCING && USE_AO MOV v_tex2, vertex.texcoord[1]; #endif #if USE_SHADOW // v_shadow = shadowTransform * position; DP4 v_shadow.x, shadowTransform[0], position; DP4 v_shadow.y, shadowTransform[1], position; DP4 v_shadow.z, shadowTransform[2], position; DP4 v_shadow.w, shadowTransform[3], position; #if USE_SHADOW_SAMPLER && USE_SHADOW_PCF // v_shadow.xy *= shadowScale.xy; DP2 v_shadow.xy, v_shadow.xy, shadowScale; #endif #endif MAD v_los, position.xz, losTransform.x, losTransform.y; END