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
|
||||
--sdl13)
|
||||
flags="$flags -DFORCE_INTERNAL_SDL=TRUE"
|
||||
echo "Warning SDL is not supported anymore"
|
||||
;;
|
||||
--dev)
|
||||
flags="$flags -DCMAKE_BUILD_TYPE=Devel"
|
||||
|
@ -36,6 +37,8 @@ do
|
|||
--release)
|
||||
flags="$flags -DCMAKE_BUILD_TYPE=Release"
|
||||
;;
|
||||
--glsl)
|
||||
flags="$flags -DGLSL_API=TRUE"
|
||||
--clean)
|
||||
clean_build=true
|
||||
;;
|
||||
|
|
|
@ -575,7 +575,7 @@ bool ZZCreate(int _width, int _height)
|
|||
#ifdef GLSL4_API
|
||||
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
|
||||
{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
|
||||
|
|
|
@ -69,7 +69,7 @@ out gl_PerVertex {
|
|||
float gl_ClipDistance[];
|
||||
};
|
||||
|
||||
layout(location = 0) in ivec2 Vert;
|
||||
layout(location = 0) in ivec4 Vert;
|
||||
layout(location = 1) in vec4 Color;
|
||||
layout(location = 2) in vec4 SecondaryColor;
|
||||
layout(location = 3) in vec3 TexCoord;
|
||||
|
@ -837,7 +837,7 @@ void SetZ() {
|
|||
#endif
|
||||
}
|
||||
|
||||
float SetPosition() {
|
||||
void SetPosition() {
|
||||
float4 position;
|
||||
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
|
||||
|
@ -853,43 +853,40 @@ float SetPosition() {
|
|||
position.w = g_fc0.y;
|
||||
|
||||
gl_Position = position;
|
||||
|
||||
// For fog
|
||||
return position.z;
|
||||
}
|
||||
|
||||
void SetFog(float z) {
|
||||
VSout.fog = z * g_fBilinear.w;
|
||||
void SetFog() {
|
||||
VSout.fog = float(Vert.z) * g_fBilinear.w;
|
||||
}
|
||||
|
||||
// just smooth shadering
|
||||
void RegularVS() {
|
||||
float z = SetPosition();
|
||||
SetPosition();
|
||||
SetColor();
|
||||
SetZ();
|
||||
}
|
||||
|
||||
// diffuse texture mapping
|
||||
void TextureVS() {
|
||||
float z = SetPosition();
|
||||
SetPosition();
|
||||
SetColor();
|
||||
SetTex();
|
||||
SetZ();
|
||||
}
|
||||
|
||||
void RegularFogVS() {
|
||||
float z = SetPosition();
|
||||
SetPosition();
|
||||
SetColor();
|
||||
SetZ();
|
||||
SetFog(z);
|
||||
SetFog();
|
||||
}
|
||||
|
||||
void TextureFogVS() {
|
||||
float z = SetPosition();
|
||||
SetPosition();
|
||||
SetColor();
|
||||
SetTex();
|
||||
SetZ();
|
||||
SetFog(z);
|
||||
SetFog();
|
||||
}
|
||||
|
||||
void BitBltVS() {
|
||||
|
|
Loading…
Reference in New Issue