Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5893: Basic cube map rendering is working now. The texture transform…
…ation applied in the OpenGLShaderPass has been moved to the shader.
- Loading branch information
1 parent
22b34e1
commit 58aa213
Showing
6 changed files
with
96 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
#version 120 | ||
|
||
uniform vec3 u_viewOrigin; | ||
uniform samplerCube u_cubemap; | ||
uniform vec3 u_view_origin; | ||
|
||
varying vec4 var_TexCoord0; | ||
varying vec3 var_dummy; | ||
|
||
void main() | ||
void main() | ||
{ | ||
gl_FragColor = vec4(1,1,1,1); | ||
//gl_FragColor.rgb = vec3(var_TexCoord0); | ||
// Swap Y and Z coordinates | ||
vec3 texcoord = vec3(var_dummy.x, var_dummy.z, var_dummy.y); | ||
|
||
gl_FragColor = texture(u_cubemap, texcoord); | ||
|
||
// compute final color | ||
//gl_FragColor = vec4(1.0, 0.0, 1.0, 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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
#version 120 | ||
|
||
// vertex attributes | ||
attribute vec4 attr_Position; | ||
attribute vec4 attr_TexCoord0; | ||
attribute vec3 attr_Tangent; | ||
attribute vec3 attr_Bitangent; | ||
attribute vec3 attr_Normal; | ||
attribute vec4 attr_TexCoord0; | ||
attribute vec3 attr_Tangent; | ||
attribute vec3 attr_Bitangent; | ||
attribute vec3 attr_Normal; | ||
|
||
uniform vec3 u_viewOrigin; | ||
uniform vec3 u_view_origin; | ||
|
||
varying vec4 var_TexCoord0; | ||
varying vec3 var_dummy; | ||
|
||
void main() | ||
void main() | ||
{ | ||
//var_TexCoord0 = attr_Position - vec4(u_viewOrigin, 1); | ||
var_TexCoord0 = attr_TexCoord0; | ||
var_dummy = gl_Vertex.xyz - u_view_origin; | ||
|
||
gl_Position = attr_Position; | ||
gl_FrontColor = gl_Color; // Pass through vertex colour | ||
// transform vertex position into homogenous clip-space | ||
gl_Position = ftransform(); | ||
|
||
// Pass through vertex colour | ||
gl_FrontColor = gl_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
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