Good afternoon,
I'm trying to implement a very simple render pipeline. A shader is used for texturing meshes without any lighting rendering technique. Here's what i've got so far:
Code:
[[FX]]
// Samplers
sampler albedoMap;
// Samplers
sampler albedoMap = sampler_state
{
Address = Clamp;
Filter = Bilinear;
MaxAnisotropy = 1;
};
context ATTRIBPASS
{
VertexShader = compile GLSL VS_GENERAL;
PixelShader = compile GLSL FS_ATTRIBPASS;
}
[[VS_GENERAL]]
// =================================================================================================
#include "shaders/utilityLib/vertCommon.glsl"
attribute vec2 texCoords0;
varying vec4 pos;
varying vec2 texCoords;
void main()
{
pos = calcWorldPos( gl_Vertex );
texCoords = texCoords0;
gl_Position = gl_ModelViewProjectionMatrix * pos;
}
[[FS_ATTRIBPASS]]
// =================================================================================================
#include "shaders/utilityLib/fragDeferredWrite.glsl"
uniform sampler2D albedoMap;
varying vec4 pos;
varying vec2 texCoords;
void main()
{
vec3 newCoords = vec3(texCoords, 0);
newCoords.t *= -1.0;
vec4 albedo = texture2D( albedoMap, newCoords.st );
vec3 newPos = pos.xyz;
setMatID( 1.0 );
setPos( newPos );
setAlbedo( albedo.rgb );
}
I'm very new to shader (and Horde3D), and something is certainly missing in this code because meshes doesn't appear at all. This code is inspired from the "model.shader" file. When i'm working with colour only (no texturing), it's working. I'm assuming that is comes from the texturing process. Any directions ?
Thanks.