-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
849 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#version 130 | ||
#extension GL_ARB_texture_rectangle : enable | ||
|
||
uniform sampler2DRect ColorTex; | ||
uniform sampler2DRect DiffuseTex; | ||
uniform sampler2DRect SpecularTex; | ||
|
||
in vec4 TexCoord0; | ||
|
||
out vec4 ColorOutput; | ||
|
||
void main() | ||
{ | ||
vec3 color = texture2DRect(ColorTex, TexCoord0.xy).rgb; | ||
vec3 diffuse = texture2DRect(DiffuseTex, TexCoord0.xy).rgb; | ||
vec3 specular = texture2DRect(SpecularTex, TexCoord0.xy).rgb; | ||
|
||
ColorOutput = vec4(color*diffuse + specular, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#version 130 | ||
|
||
uniform mat4 osg_ProjectionMatrix; | ||
|
||
in vec4 osg_Vertex; | ||
in vec4 osg_MultiTexCoord0; | ||
|
||
out vec4 TexCoord0; | ||
|
||
void main() | ||
{ | ||
gl_Position = osg_ProjectionMatrix * osg_Vertex; | ||
TexCoord0 = osg_MultiTexCoord0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#version 130 | ||
#extension GL_ARB_texture_rectangle : enable | ||
|
||
in vec3 localLightDir; | ||
|
||
uniform vec4 ambient_color; | ||
uniform vec4 diffuse_color; | ||
uniform vec4 specular_color; | ||
|
||
uniform sampler2DRect ColorTex; | ||
uniform sampler2DRect NormalTex; | ||
uniform sampler2DRect PosTex; | ||
|
||
out vec4 DiffuseData; | ||
out vec4 SpecularData; | ||
|
||
void main() | ||
{ | ||
vec4 c_viewspace = texture2DRect(ColorTex, gl_FragCoord.xy); | ||
vec3 n_viewspace = texture2DRect(NormalTex, gl_FragCoord.xy).xyz*2.0 - vec3(1.0); | ||
vec3 p_viewspace = texture2DRect(PosTex, gl_FragCoord.xy).xyz; | ||
vec3 s_viewspace = vec3(1.0); | ||
|
||
// Direction from point to light (not vice versa!) | ||
vec3 lightDir_viewspace = normalize(-localLightDir); | ||
|
||
// Lambertian diffuse color. | ||
vec3 diff = max(ambient_color.rgb, | ||
diffuse_color.rgb * s_viewspace * dot(lightDir_viewspace, n_viewspace) | ||
); | ||
|
||
// Direction from point to camera. | ||
vec3 viewDir_viewspace = normalize(-p_viewspace); | ||
|
||
// Blinn-Phong specular highlights. | ||
vec3 h_viewspace = normalize(lightDir_viewspace + viewDir_viewspace); | ||
float amount = max(0.0, dot(h_viewspace, n_viewspace)); | ||
vec3 spec = specular_color.rgb * s_viewspace * pow(amount, 32.0) * c_viewspace.a; | ||
|
||
DiffuseData = vec4(diff, 1.0); | ||
SpecularData = vec4(spec, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#version 130 | ||
|
||
uniform mat4 osg_ProjectionMatrix; | ||
uniform mat4 osg_ModelViewMatrix; | ||
|
||
uniform vec3 light_direction; | ||
|
||
in vec4 osg_Vertex; | ||
|
||
out vec3 localLightDir; | ||
|
||
void main() | ||
{ | ||
localLightDir = mat3(osg_ModelViewMatrix) * light_direction; | ||
|
||
// Vertex position in main camera Screen space. | ||
gl_Position = osg_ProjectionMatrix * osg_Vertex; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#version 130 | ||
|
||
uniform vec4 illumination_color; | ||
|
||
uniform sampler2D diffuseTex; | ||
|
||
in vec3 pos_viewspace; | ||
in vec3 n_viewspace; | ||
in vec3 t_viewspace; | ||
in vec3 b_viewspace; | ||
in vec4 TexCoords; | ||
in vec4 Color; | ||
|
||
out vec4 ColorData; | ||
out vec4 NormalData; | ||
out vec4 PositionData; | ||
out vec4 IlluminationData; | ||
|
||
void main() | ||
{ | ||
vec4 color = vec4(texture2D(diffuseTex, TexCoords.xy).rgb, 0.0); | ||
vec4 nn = vec4(0.5, 0.5, 1.0, 1.0); | ||
|
||
mat3 nmat = mat3(normalize(t_viewspace), | ||
normalize(b_viewspace), | ||
normalize(n_viewspace)); | ||
|
||
ColorData = color * vec4(Color.rgb, 1.0); | ||
NormalData = vec4(nmat*(nn.xyz - vec3(0.5)) + vec3(0.5), nn.w); | ||
PositionData = vec4(pos_viewspace, gl_FragCoord.z); | ||
IlluminationData = illumination_color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#version 130 | ||
|
||
uniform mat4 osg_ModelViewProjectionMatrix; | ||
uniform mat4 osg_ModelViewMatrix; | ||
|
||
in vec4 osg_Vertex; | ||
in vec3 osg_Normal; | ||
in vec4 osg_Color; | ||
in vec4 osg_MultiTexCoord0; | ||
|
||
out vec3 pos_viewspace; | ||
out vec3 n_viewspace; | ||
out vec3 t_viewspace; | ||
out vec3 b_viewspace; | ||
out vec4 TexCoords; | ||
out vec4 Color; | ||
|
||
void main() | ||
{ | ||
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex; | ||
TexCoords = osg_MultiTexCoord0; | ||
Color = osg_Color; | ||
|
||
pos_viewspace = (osg_ModelViewMatrix * osg_Vertex).xyz; | ||
|
||
vec3 binormal = cross(osg_Normal, vec3(1.0, 0.0, 0.0)); | ||
n_viewspace = normalize(mat3(osg_ModelViewMatrix) * osg_Normal); | ||
t_viewspace = normalize(mat3(osg_ModelViewMatrix) * cross(osg_Normal, binormal)); | ||
b_viewspace = normalize(mat3(osg_ModelViewMatrix) * binormal); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#version 130 | ||
#extension GL_ARB_texture_rectangle : enable | ||
|
||
uniform sampler2DRect TexImage; | ||
|
||
in vec4 TexCoord0; | ||
|
||
out vec4 ColorOutput; | ||
|
||
void main() | ||
{ | ||
ColorOutput = texture2DRect(TexImage, TexCoord0.xy); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#version 130 | ||
|
||
uniform mat4 osg_ProjectionMatrix; | ||
|
||
in vec4 osg_Vertex; | ||
in vec4 osg_MultiTexCoord0; | ||
|
||
out vec4 TexCoord0; | ||
|
||
void main() | ||
{ | ||
gl_Position = osg_ProjectionMatrix * osg_Vertex; | ||
TexCoord0 = osg_MultiTexCoord0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#version 130 | ||
|
||
uniform sampler2D TexImage; | ||
|
||
in vec4 Color; | ||
in vec4 TexCoord0; | ||
|
||
out vec4 ColorOutput; | ||
|
||
void main() | ||
{ | ||
ColorOutput = texture2D(TexImage, TexCoord0.xy) * Color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#version 130 | ||
|
||
uniform mat4 osg_ProjectionMatrix; | ||
|
||
in vec4 osg_Vertex; | ||
in vec4 osg_Color; | ||
in vec4 osg_MultiTexCoord0; | ||
|
||
out vec4 Color; | ||
out vec4 TexCoord0; | ||
|
||
void main() | ||
{ | ||
gl_Position = osg_ProjectionMatrix * osg_Vertex; | ||
TexCoord0 = osg_MultiTexCoord0; | ||
Color = osg_Color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#version 130 | ||
|
||
uniform vec4 illumination_color; | ||
|
||
uniform sampler2D diffuseTex; | ||
|
||
in vec3 pos_viewspace; | ||
in vec3 n_viewspace; | ||
in vec3 t_viewspace; | ||
in vec3 b_viewspace; | ||
in vec4 TexCoords; | ||
in vec4 Color; | ||
|
||
out vec4 ColorData; | ||
out vec4 NormalData; | ||
out vec4 PositionData; | ||
out vec4 IlluminationData; | ||
|
||
void main() | ||
{ | ||
vec4 color = texture2D(diffuseTex, TexCoords.xy); | ||
color.a = ((color.a < 0.5) ? 1.0 : 0.0); | ||
vec4 nn = vec4(0.5, 0.5, 1.0, 1.0); | ||
|
||
mat3 nmat = mat3(normalize(t_viewspace), | ||
normalize(b_viewspace), | ||
normalize(n_viewspace)); | ||
|
||
ColorData = color * vec4(Color.rgb, 1.0); | ||
NormalData = vec4(nmat*(nn.xyz - vec3(0.5)) + vec3(0.5), nn.w); | ||
PositionData = vec4(pos_viewspace, gl_FragCoord.z); | ||
IlluminationData = illumination_color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#version 130 | ||
|
||
uniform mat4 osg_ModelViewProjectionMatrix; | ||
uniform mat4 osg_ModelViewMatrix; | ||
|
||
in vec4 osg_Vertex; | ||
in vec3 osg_Normal; | ||
in vec4 osg_Color; | ||
in vec4 osg_MultiTexCoord0; | ||
|
||
out vec3 pos_viewspace; | ||
out vec3 n_viewspace; | ||
out vec3 t_viewspace; | ||
out vec3 b_viewspace; | ||
out vec4 TexCoords; | ||
out vec4 Color; | ||
|
||
void main() | ||
{ | ||
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex; | ||
TexCoords = osg_MultiTexCoord0; | ||
Color = osg_Color; | ||
|
||
pos_viewspace = (osg_ModelViewMatrix * osg_Vertex).xyz; | ||
|
||
vec3 binormal = cross(osg_Normal, vec3(1.0, 0.0, 0.0)); | ||
n_viewspace = normalize(mat3(osg_ModelViewMatrix) * osg_Normal); | ||
t_viewspace = normalize(mat3(osg_ModelViewMatrix) * cross(osg_Normal, binormal)); | ||
b_viewspace = normalize(mat3(osg_ModelViewMatrix) * binormal); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Set data-root to your Daggerfall's arena2 directory | ||
# data-root = $HOME/.wine/drive_c/Games/Daggerfall/arena2 | ||
data = ${DATA_PATH}/MyGUI_Media | ||
data = ${DATA_PATH}/data | ||
data = ${DATA_PATH}/data/MyGUI_Media |
Oops, something went wrong.