Compare commits
No commits in common. "d2e5d9edfe90de5f2e05a641a9bbaab1d4583098" and "0bfe50d61a064fba55dad65616cc89dbb9679849" have entirely different histories.
d2e5d9edfe
...
0bfe50d61a
9 changed files with 11 additions and 54 deletions
18
main.c
18
main.c
|
|
@ -15,7 +15,8 @@ shaders/sierp.fs
|
||||||
shaders/joliesformes.fs
|
shaders/joliesformes.fs
|
||||||
shaders/orthogonalView.fs
|
shaders/orthogonalView.fs
|
||||||
*/
|
*/
|
||||||
#define SCENE "shaders/default.fs"
|
#define SCENE "shaders/orthogonalView.fs"
|
||||||
|
//#define SCENE "shaders/immeublesparisiens.fs"
|
||||||
#define FULLSCREEN 0
|
#define FULLSCREEN 0
|
||||||
#define EXPERIMENTAL_FEATURES 0
|
#define EXPERIMENTAL_FEATURES 0
|
||||||
/* ## DEBUG MODE ##
|
/* ## DEBUG MODE ##
|
||||||
|
|
@ -24,11 +25,10 @@ shaders/orthogonalView.fs
|
||||||
* 2 for FPS
|
* 2 for FPS
|
||||||
* 3 for cursor position
|
* 3 for cursor position
|
||||||
* 5 for scroll level and precision
|
* 5 for scroll level and precision
|
||||||
* 7 for orthogonal information
|
|
||||||
*
|
*
|
||||||
* For instance if you want fps and position set the value to 2*3=6
|
* For instance if you want fps and position set the value to 2*3=6
|
||||||
*/
|
*/
|
||||||
#define DEBUG_MODE 7
|
#define DEBUG_MODE 1
|
||||||
|
|
||||||
GLuint screenWidth = 720, screenHeight = 480;
|
GLuint screenWidth = 720, screenHeight = 480;
|
||||||
const GLFWvidmode* mode;
|
const GLFWvidmode* mode;
|
||||||
|
|
@ -61,7 +61,6 @@ bool leftar = false;
|
||||||
bool rightar = false;
|
bool rightar = false;
|
||||||
bool forwardar = false;
|
bool forwardar = false;
|
||||||
bool backwardar = false;
|
bool backwardar = false;
|
||||||
int orthoView = 0;
|
|
||||||
|
|
||||||
float fovValue=1.0;
|
float fovValue=1.0;
|
||||||
//281=3.13/2 * 180
|
//281=3.13/2 * 180
|
||||||
|
|
@ -109,14 +108,6 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
||||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (key == GLFW_KEY_TAB) {
|
|
||||||
orthoView = (orthoView + 1) % 2;
|
|
||||||
if (DEBUG_MODE % 7 == 0) {
|
|
||||||
printf("Orthogonal view : ");
|
|
||||||
printf((orthoView == 1) ? "on" : "off");
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (key == GLFW_KEY_BACKSPACE)
|
if (key == GLFW_KEY_BACKSPACE)
|
||||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
if (key == GLFW_KEY_SPACE)
|
if (key == GLFW_KEY_SPACE)
|
||||||
|
|
@ -340,8 +331,7 @@ int main (){
|
||||||
glUniform3f(glGetUniformLocation(quad_shader, "iEy"), ey[0],ey[1],ey[2]);
|
glUniform3f(glGetUniformLocation(quad_shader, "iEy"), ey[0],ey[1],ey[2]);
|
||||||
glUniform3f(glGetUniformLocation(quad_shader, "iEz"), ez[0],ez[1],ez[2]);
|
glUniform3f(glGetUniformLocation(quad_shader, "iEz"), ez[0],ez[1],ez[2]);
|
||||||
glUniform3f(glGetUniformLocation(quad_shader, "iCamPos"), camPosX,camPosY,camPosZ);
|
glUniform3f(glGetUniformLocation(quad_shader, "iCamPos"), camPosX,camPosY,camPosZ);
|
||||||
glUniform1f(glGetUniformLocation(quad_shader, "iFovValue"), (orthoView == 1) ? 2/(fovValue*fovValue*multiplicatorFov) : fovValue*fovValue*multiplicatorFov);
|
glUniform1f(glGetUniformLocation(quad_shader, "iFovValue"), fovValue*fovValue*multiplicatorFov);
|
||||||
glUniform1i(glGetUniformLocation(quad_shader, "iOrthoView"), orthoView);
|
|
||||||
// glBindVertexArray(0); // no need to unbind it every time
|
// glBindVertexArray(0); // no need to unbind it every time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ in vec3 Ez;
|
||||||
in vec3 CamPos;
|
in vec3 CamPos;
|
||||||
in float fovValue;
|
in float fovValue;
|
||||||
in float FacteurLargeur;
|
in float FacteurLargeur;
|
||||||
in float OrthoView;
|
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
//uniform sampler2D generalTexture;
|
//uniform sampler2D generalTexture;
|
||||||
|
|
@ -216,7 +215,7 @@ void main(){
|
||||||
|
|
||||||
vec3 dir = normalize(FragCoord.x * normalize(Ex) + FragCoord.y * normalize(Ey) + fovValue * Ez);
|
vec3 dir = normalize(FragCoord.x * normalize(Ex) + FragCoord.y * normalize(Ey) + fovValue * Ez);
|
||||||
|
|
||||||
if(OrthoView == 1.){
|
if(sin(Time)<0.){
|
||||||
//float c=Mandel(FragCoord*1.5);
|
//float c=Mandel(FragCoord*1.5);
|
||||||
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ out vec3 Ez;
|
||||||
out vec3 CamPos;
|
out vec3 CamPos;
|
||||||
out float fovValue;
|
out float fovValue;
|
||||||
out float FacteurLargeur;
|
out float FacteurLargeur;
|
||||||
out float OrthoView;
|
|
||||||
|
|
||||||
uniform float iTime;
|
uniform float iTime;
|
||||||
uniform vec3 iEx;
|
uniform vec3 iEx;
|
||||||
|
|
@ -20,7 +19,6 @@ uniform vec3 iEz;
|
||||||
uniform vec3 iCamPos;
|
uniform vec3 iCamPos;
|
||||||
uniform float iFovValue;
|
uniform float iFovValue;
|
||||||
uniform float iFacteurLargeur;
|
uniform float iFacteurLargeur;
|
||||||
uniform int iOrthoView;
|
|
||||||
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
|
|
@ -34,5 +32,4 @@ void main()
|
||||||
CamPos = iCamPos;
|
CamPos = iCamPos;
|
||||||
fovValue = iFovValue;
|
fovValue = iFovValue;
|
||||||
FacteurLargeur=iFacteurLargeur;
|
FacteurLargeur=iFacteurLargeur;
|
||||||
OrthoView = iOrthoView;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ in vec3 Ez;
|
||||||
in vec3 CamPos;
|
in vec3 CamPos;
|
||||||
in float fovValue;
|
in float fovValue;
|
||||||
in float FacteurLargeur;
|
in float FacteurLargeur;
|
||||||
in float OrthoView;
|
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
//uniform sampler2D generalTexture;
|
//uniform sampler2D generalTexture;
|
||||||
|
|
@ -135,10 +134,6 @@ void main(){
|
||||||
vec3 dir = normalize(FragCoord.x * normalize(Ex) + FragCoord.y * normalize(Ey) + fovValue * Ez);
|
vec3 dir = normalize(FragCoord.x * normalize(Ex) + FragCoord.y * normalize(Ey) + fovValue * Ez);
|
||||||
|
|
||||||
|
|
||||||
if(OrthoView == 1.){
|
|
||||||
//float c=Mandel(FragCoord*1.5);
|
//float c=Mandel(FragCoord*1.5);
|
||||||
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
||||||
}else{
|
|
||||||
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ in vec3 Ez;
|
||||||
in vec3 CamPos;
|
in vec3 CamPos;
|
||||||
in float fovValue;
|
in float fovValue;
|
||||||
in float FacteurLargeur;
|
in float FacteurLargeur;
|
||||||
in float OrthoView;
|
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
//uniform sampler2D generalTexture;
|
//uniform sampler2D generalTexture;
|
||||||
|
|
@ -171,10 +170,6 @@ void main(){
|
||||||
vec3 dir = normalize(FragCoord.x * normalize(Ex) + FragCoord.y * normalize(Ey) + fovValue * Ez);
|
vec3 dir = normalize(FragCoord.x * normalize(Ex) + FragCoord.y * normalize(Ey) + fovValue * Ez);
|
||||||
|
|
||||||
|
|
||||||
if(OrthoView == 1.){
|
|
||||||
//float c=Mandel(FragCoord*1.5);
|
//float c=Mandel(FragCoord*1.5);
|
||||||
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
||||||
}else{
|
|
||||||
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ in vec3 Ez;
|
||||||
in vec3 CamPos;
|
in vec3 CamPos;
|
||||||
in float fovValue;
|
in float fovValue;
|
||||||
in float FacteurLargeur;
|
in float FacteurLargeur;
|
||||||
in float OrthoView;
|
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
//uniform sampler2D generalTexture;
|
//uniform sampler2D generalTexture;
|
||||||
|
|
@ -153,10 +152,5 @@ void main(){
|
||||||
|
|
||||||
|
|
||||||
//float c=Mandel(FragCoord*1.5);
|
//float c=Mandel(FragCoord*1.5);
|
||||||
if(OrthoView == 1.){
|
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
||||||
//float c=Mandel(FragCoord*1.5);
|
|
||||||
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
|
||||||
}else{
|
|
||||||
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ in vec3 Ez;
|
||||||
in vec3 CamPos;
|
in vec3 CamPos;
|
||||||
in float fovValue;
|
in float fovValue;
|
||||||
in float FacteurLargeur;
|
in float FacteurLargeur;
|
||||||
in float OrthoView;
|
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
//uniform sampler2D generalTexture;
|
//uniform sampler2D generalTexture;
|
||||||
|
|
@ -216,7 +215,7 @@ void main(){
|
||||||
|
|
||||||
vec3 dir = normalize(FragCoord.x * normalize(Ex) + FragCoord.y * normalize(Ey) + fovValue * Ez);
|
vec3 dir = normalize(FragCoord.x * normalize(Ex) + FragCoord.y * normalize(Ey) + fovValue * Ez);
|
||||||
|
|
||||||
if(OrthoView == 1.){
|
if(sin(Time)<0.){
|
||||||
//float c=Mandel(FragCoord*1.5);
|
//float c=Mandel(FragCoord*1.5);
|
||||||
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ in vec3 Ez;
|
||||||
in vec3 CamPos;
|
in vec3 CamPos;
|
||||||
in float fovValue;
|
in float fovValue;
|
||||||
in float FacteurLargeur;
|
in float FacteurLargeur;
|
||||||
in float OrthoView;
|
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
//uniform sampler2D generalTexture;
|
//uniform sampler2D generalTexture;
|
||||||
|
|
@ -121,10 +120,5 @@ void main(){
|
||||||
|
|
||||||
|
|
||||||
//float c=Mandel(FragCoord*1.5);
|
//float c=Mandel(FragCoord*1.5);
|
||||||
if(OrthoView == 1.){
|
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
||||||
//float c=Mandel(FragCoord*1.5);
|
|
||||||
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
|
||||||
}else{
|
|
||||||
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ in vec3 Ez;
|
||||||
in vec3 CamPos;
|
in vec3 CamPos;
|
||||||
in float fovValue;
|
in float fovValue;
|
||||||
in float FacteurLargeur;
|
in float FacteurLargeur;
|
||||||
in float OrthoView;
|
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
//uniform sampler2D generalTexture;
|
//uniform sampler2D generalTexture;
|
||||||
|
|
@ -180,10 +179,5 @@ void main(){
|
||||||
|
|
||||||
|
|
||||||
//float c=Mandel(FragCoord*1.5);
|
//float c=Mandel(FragCoord*1.5);
|
||||||
if(OrthoView == 1.){
|
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
||||||
//float c=Mandel(FragCoord*1.5);
|
|
||||||
FragColor=vec4(Get_Color(posCam+fovValue*FragCoord.x*normalize(Ex)+fovValue*FragCoord.y*normalize(Ey),normalize(Ez)),1.);//c,c,c,1.);
|
|
||||||
}else{
|
|
||||||
FragColor=vec4(Get_Color(posCam,dir),1.);//c,c,c,1.);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue