mirror of https://github.com/PCSX2/pcsx2.git
zzogl glsl: used the fog parameter correctly...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5256 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
0dc1e7f4bb
commit
333b74c2a5
3
build.sh
3
build.sh
|
@ -23,6 +23,7 @@ do
|
||||||
case $f in
|
case $f in
|
||||||
--sdl13)
|
--sdl13)
|
||||||
flags="$flags -DFORCE_INTERNAL_SDL=TRUE"
|
flags="$flags -DFORCE_INTERNAL_SDL=TRUE"
|
||||||
|
echo "Warning SDL is not supported anymore"
|
||||||
;;
|
;;
|
||||||
--dev)
|
--dev)
|
||||||
flags="$flags -DCMAKE_BUILD_TYPE=Devel"
|
flags="$flags -DCMAKE_BUILD_TYPE=Devel"
|
||||||
|
@ -36,6 +37,8 @@ do
|
||||||
--release)
|
--release)
|
||||||
flags="$flags -DCMAKE_BUILD_TYPE=Release"
|
flags="$flags -DCMAKE_BUILD_TYPE=Release"
|
||||||
;;
|
;;
|
||||||
|
--glsl)
|
||||||
|
flags="$flags -DGLSL_API=TRUE"
|
||||||
--clean)
|
--clean)
|
||||||
clean_build=true
|
clean_build=true
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -575,7 +575,7 @@ bool ZZCreate(int _width, int _height)
|
||||||
#ifdef GLSL4_API
|
#ifdef GLSL4_API
|
||||||
GSInputLayoutOGL vert_format[] =
|
GSInputLayoutOGL vert_format[] =
|
||||||
{
|
{
|
||||||
{0 , 2 , GL_SHORT , GL_FALSE , sizeof(VertexGPU) , (const GLvoid*)(0) } , // vertex
|
{0 , 4 , GL_SHORT , GL_FALSE , sizeof(VertexGPU) , (const GLvoid*)(0) } , // vertex
|
||||||
{1 , 4 , GL_UNSIGNED_BYTE , GL_TRUE , sizeof(VertexGPU) , (const GLvoid*)(8) } , // color
|
{1 , 4 , GL_UNSIGNED_BYTE , GL_TRUE , sizeof(VertexGPU) , (const GLvoid*)(8) } , // color
|
||||||
{2 , 4 , GL_UNSIGNED_BYTE , GL_TRUE , sizeof(VertexGPU) , (const GLvoid*)(12) } , // z value. FIXME WTF 4 unsigned byte, why not a full integer
|
{2 , 4 , GL_UNSIGNED_BYTE , GL_TRUE , sizeof(VertexGPU) , (const GLvoid*)(12) } , // z value. FIXME WTF 4 unsigned byte, why not a full integer
|
||||||
{3 , 3 , GL_FLOAT , GL_FALSE , sizeof(VertexGPU) , (const GLvoid*)(16) } , // tex coord
|
{3 , 3 , GL_FLOAT , GL_FALSE , sizeof(VertexGPU) , (const GLvoid*)(16) } , // tex coord
|
||||||
|
|
|
@ -69,7 +69,7 @@ out gl_PerVertex {
|
||||||
float gl_ClipDistance[];
|
float gl_ClipDistance[];
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(location = 0) in ivec2 Vert;
|
layout(location = 0) in ivec4 Vert;
|
||||||
layout(location = 1) in vec4 Color;
|
layout(location = 1) in vec4 Color;
|
||||||
layout(location = 2) in vec4 SecondaryColor;
|
layout(location = 2) in vec4 SecondaryColor;
|
||||||
layout(location = 3) in vec3 TexCoord;
|
layout(location = 3) in vec3 TexCoord;
|
||||||
|
@ -837,7 +837,7 @@ void SetZ() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
float SetPosition() {
|
void SetPosition() {
|
||||||
float4 position;
|
float4 position;
|
||||||
position.xy = vec2(Vert.xy) * g_fPosXY.xy + g_fPosXY.zw;
|
position.xy = vec2(Vert.xy) * g_fPosXY.xy + g_fPosXY.zw;
|
||||||
// FIXME: the factor in normal mode seem bogus. They don't have same order than in log mode. Or I failed to understand the logic
|
// FIXME: the factor in normal mode seem bogus. They don't have same order than in log mode. Or I failed to understand the logic
|
||||||
|
@ -853,43 +853,40 @@ float SetPosition() {
|
||||||
position.w = g_fc0.y;
|
position.w = g_fc0.y;
|
||||||
|
|
||||||
gl_Position = position;
|
gl_Position = position;
|
||||||
|
|
||||||
// For fog
|
|
||||||
return position.z;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetFog(float z) {
|
void SetFog() {
|
||||||
VSout.fog = z * g_fBilinear.w;
|
VSout.fog = float(Vert.z) * g_fBilinear.w;
|
||||||
}
|
}
|
||||||
|
|
||||||
// just smooth shadering
|
// just smooth shadering
|
||||||
void RegularVS() {
|
void RegularVS() {
|
||||||
float z = SetPosition();
|
SetPosition();
|
||||||
SetColor();
|
SetColor();
|
||||||
SetZ();
|
SetZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// diffuse texture mapping
|
// diffuse texture mapping
|
||||||
void TextureVS() {
|
void TextureVS() {
|
||||||
float z = SetPosition();
|
SetPosition();
|
||||||
SetColor();
|
SetColor();
|
||||||
SetTex();
|
SetTex();
|
||||||
SetZ();
|
SetZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegularFogVS() {
|
void RegularFogVS() {
|
||||||
float z = SetPosition();
|
SetPosition();
|
||||||
SetColor();
|
SetColor();
|
||||||
SetZ();
|
SetZ();
|
||||||
SetFog(z);
|
SetFog();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureFogVS() {
|
void TextureFogVS() {
|
||||||
float z = SetPosition();
|
SetPosition();
|
||||||
SetColor();
|
SetColor();
|
||||||
SetTex();
|
SetTex();
|
||||||
SetZ();
|
SetZ();
|
||||||
SetFog(z);
|
SetFog();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitBltVS() {
|
void BitBltVS() {
|
||||||
|
|
Loading…
Reference in New Issue