OpenGL 4.6 Game Program - Water Reflection - Flicker Problem
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
With my water render, I am having an issue, where based on the camera position and orientation, there is a "flicker" effect/problem on the terrain in the game. Basically, a gray overlay "flickers" onto the terrain, but then disappears. This repeats as the camera position/orientation is changed.
Specifically, it happens on only specific terrain "islands" and near the part of the terrain which intersects the water quad.
So, to illustrate the issue:
Water with no flicker
Water with flicker; In the bottom right hand side of the image, there is a slight gray overlay on the "small" island that protrudes from the main island.
Additionally, here is an animated .gif demonstrating the issue:
As a final note, this flickering does not happen, say, for the large body of terrain in the background.
Could anyone please let me know what additional details I need to provide, as well as point me in the right direction as to the problem and possible resolution?
Thank you in advance!
Below is my process of mapping the reflection to the water quad:
I first created one frame buffer object upon program start up:
Framebuffer Object Creation:
// FBO objct
unsigned int framebuffer;
glGenFramebuffers(1, &framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// generate texture
unsigned int texColorBuffer;
glGenTextures(1, &texColorBuffer);
glBindTexture(GL_TEXTURE_2D, texColorBuffer);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1024, 768, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, 0);
// attach it to currently bound framebuffer object
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texColorBuffer, 0);
unsigned int rbo;
glGenRenderbuffers(1, &rbo);
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 1024, 768);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
std::cout << "ERROR::FRAMEBUFFER:: Framebuffer is not complete!" << std::endl;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
I created a single water quad:
// real_offsets needed for instancing
std::vector<glm::vec2> real_offsets;
real_offsets.push_back(glm::vec2(650, 450));
glm::mat4 waterQuad = glm::mat4(1.0f);
waterQuad = translate(waterQuad, vec3(0, 480.0, 0));
waterQuad = scale(waterQuad, vec3(100, 1, 100));
objects.push_back(std::shared_ptr <Object>(new Object("waterpane_very_low.obj", waterQuad, real_offsets, true, false
, glm::vec3(0.0, 0.5, 1.0))));
Then in the main game loop, I used the frame buffer object to save a snapshot of the scene:
Main Game Loop:
do {
glEnable(GL_CLIP_DISTANCE0);
// Use frame buffer object
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw scene with no water quad to FBO
// [...]
// Disable frame buffer object
glBindFramebuffer(GL_FRAMEBUFFER, 0);
// Save frame buffer object texture to texture unit 0 to use later
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texColorBuffer);
glDisable(GL_CLIP_DISTANCE0);
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw whole scene, including water quad as normal
// [...]
// Swap buffers
glfwSwapBuffers(window);
glfwPollEvents();
} while (glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS && glfwWindowShouldClose(window) == 0);
In my normal object's shader, I enabled a clip plane to control what is drawn to the reflection texture: NormalObjects.vertexshader:
const vec4 plane = vec4(0,1,0,-480);
gl_ClipDistance[0] = dot( M * vec4(vertex,1), plane);
gl_Position = MVP * vec4(vertex,1);
In my water.vertexshader, I performed necessary calculations to transform a local vertex: water.vertexshader:
// MVP_offset = P * V * M_offset, where M_offset depends on a vector of vecs2 passed in containing instancing offsets
clipSpace = MVP_offset * vec4(vertex,1.0);
gl_Position = MVP_offset * vec4(vertex,1.0); // instanced vertex
Then in my water.fragmentshader, I applied Blinn-Phong shading and sampled the reflection texture and projectively mapped it: water.fragmentshader:
// Sampler variable
uniform sampler2D waterTexture;
// Projectively map the reflection texture
vec2 clipProj = (clipSpace.xy / clipSpace.w) / 2.0 + 0.5;
clipProj.y *= -1.0f; // flip texture around
// waterTexture was assigned texture unit 0
vec4 finalVec = vec4(texture(waterTexture, clipProj).rgb, 1.0);
vec4 finalVec2 = finalVec * vec4(ambientComponent() + diffuseComponent(modelNormal,lightVec) + specularComponent(modelNormal, lightVec), 1.0);
FragColor = finalVec2;
c++ opengl
add a comment |
With my water render, I am having an issue, where based on the camera position and orientation, there is a "flicker" effect/problem on the terrain in the game. Basically, a gray overlay "flickers" onto the terrain, but then disappears. This repeats as the camera position/orientation is changed.
Specifically, it happens on only specific terrain "islands" and near the part of the terrain which intersects the water quad.
So, to illustrate the issue:
Water with no flicker
Water with flicker; In the bottom right hand side of the image, there is a slight gray overlay on the "small" island that protrudes from the main island.
Additionally, here is an animated .gif demonstrating the issue:
As a final note, this flickering does not happen, say, for the large body of terrain in the background.
Could anyone please let me know what additional details I need to provide, as well as point me in the right direction as to the problem and possible resolution?
Thank you in advance!
Below is my process of mapping the reflection to the water quad:
I first created one frame buffer object upon program start up:
Framebuffer Object Creation:
// FBO objct
unsigned int framebuffer;
glGenFramebuffers(1, &framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// generate texture
unsigned int texColorBuffer;
glGenTextures(1, &texColorBuffer);
glBindTexture(GL_TEXTURE_2D, texColorBuffer);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1024, 768, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, 0);
// attach it to currently bound framebuffer object
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texColorBuffer, 0);
unsigned int rbo;
glGenRenderbuffers(1, &rbo);
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 1024, 768);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
std::cout << "ERROR::FRAMEBUFFER:: Framebuffer is not complete!" << std::endl;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
I created a single water quad:
// real_offsets needed for instancing
std::vector<glm::vec2> real_offsets;
real_offsets.push_back(glm::vec2(650, 450));
glm::mat4 waterQuad = glm::mat4(1.0f);
waterQuad = translate(waterQuad, vec3(0, 480.0, 0));
waterQuad = scale(waterQuad, vec3(100, 1, 100));
objects.push_back(std::shared_ptr <Object>(new Object("waterpane_very_low.obj", waterQuad, real_offsets, true, false
, glm::vec3(0.0, 0.5, 1.0))));
Then in the main game loop, I used the frame buffer object to save a snapshot of the scene:
Main Game Loop:
do {
glEnable(GL_CLIP_DISTANCE0);
// Use frame buffer object
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw scene with no water quad to FBO
// [...]
// Disable frame buffer object
glBindFramebuffer(GL_FRAMEBUFFER, 0);
// Save frame buffer object texture to texture unit 0 to use later
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texColorBuffer);
glDisable(GL_CLIP_DISTANCE0);
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw whole scene, including water quad as normal
// [...]
// Swap buffers
glfwSwapBuffers(window);
glfwPollEvents();
} while (glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS && glfwWindowShouldClose(window) == 0);
In my normal object's shader, I enabled a clip plane to control what is drawn to the reflection texture: NormalObjects.vertexshader:
const vec4 plane = vec4(0,1,0,-480);
gl_ClipDistance[0] = dot( M * vec4(vertex,1), plane);
gl_Position = MVP * vec4(vertex,1);
In my water.vertexshader, I performed necessary calculations to transform a local vertex: water.vertexshader:
// MVP_offset = P * V * M_offset, where M_offset depends on a vector of vecs2 passed in containing instancing offsets
clipSpace = MVP_offset * vec4(vertex,1.0);
gl_Position = MVP_offset * vec4(vertex,1.0); // instanced vertex
Then in my water.fragmentshader, I applied Blinn-Phong shading and sampled the reflection texture and projectively mapped it: water.fragmentshader:
// Sampler variable
uniform sampler2D waterTexture;
// Projectively map the reflection texture
vec2 clipProj = (clipSpace.xy / clipSpace.w) / 2.0 + 0.5;
clipProj.y *= -1.0f; // flip texture around
// waterTexture was assigned texture unit 0
vec4 finalVec = vec4(texture(waterTexture, clipProj).rgb, 1.0);
vec4 finalVec2 = finalVec * vec4(ambientComponent() + diffuseComponent(modelNormal,lightVec) + specularComponent(modelNormal, lightVec), 1.0);
FragColor = finalVec2;
c++ opengl
Details would include what your code is doing...
– immibis
Jan 4 at 6:53
1
@immibis Sorry, I've updated my post with the related code.
– Mo D1N
Jan 4 at 8:46
add a comment |
With my water render, I am having an issue, where based on the camera position and orientation, there is a "flicker" effect/problem on the terrain in the game. Basically, a gray overlay "flickers" onto the terrain, but then disappears. This repeats as the camera position/orientation is changed.
Specifically, it happens on only specific terrain "islands" and near the part of the terrain which intersects the water quad.
So, to illustrate the issue:
Water with no flicker
Water with flicker; In the bottom right hand side of the image, there is a slight gray overlay on the "small" island that protrudes from the main island.
Additionally, here is an animated .gif demonstrating the issue:
As a final note, this flickering does not happen, say, for the large body of terrain in the background.
Could anyone please let me know what additional details I need to provide, as well as point me in the right direction as to the problem and possible resolution?
Thank you in advance!
Below is my process of mapping the reflection to the water quad:
I first created one frame buffer object upon program start up:
Framebuffer Object Creation:
// FBO objct
unsigned int framebuffer;
glGenFramebuffers(1, &framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// generate texture
unsigned int texColorBuffer;
glGenTextures(1, &texColorBuffer);
glBindTexture(GL_TEXTURE_2D, texColorBuffer);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1024, 768, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, 0);
// attach it to currently bound framebuffer object
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texColorBuffer, 0);
unsigned int rbo;
glGenRenderbuffers(1, &rbo);
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 1024, 768);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
std::cout << "ERROR::FRAMEBUFFER:: Framebuffer is not complete!" << std::endl;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
I created a single water quad:
// real_offsets needed for instancing
std::vector<glm::vec2> real_offsets;
real_offsets.push_back(glm::vec2(650, 450));
glm::mat4 waterQuad = glm::mat4(1.0f);
waterQuad = translate(waterQuad, vec3(0, 480.0, 0));
waterQuad = scale(waterQuad, vec3(100, 1, 100));
objects.push_back(std::shared_ptr <Object>(new Object("waterpane_very_low.obj", waterQuad, real_offsets, true, false
, glm::vec3(0.0, 0.5, 1.0))));
Then in the main game loop, I used the frame buffer object to save a snapshot of the scene:
Main Game Loop:
do {
glEnable(GL_CLIP_DISTANCE0);
// Use frame buffer object
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw scene with no water quad to FBO
// [...]
// Disable frame buffer object
glBindFramebuffer(GL_FRAMEBUFFER, 0);
// Save frame buffer object texture to texture unit 0 to use later
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texColorBuffer);
glDisable(GL_CLIP_DISTANCE0);
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw whole scene, including water quad as normal
// [...]
// Swap buffers
glfwSwapBuffers(window);
glfwPollEvents();
} while (glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS && glfwWindowShouldClose(window) == 0);
In my normal object's shader, I enabled a clip plane to control what is drawn to the reflection texture: NormalObjects.vertexshader:
const vec4 plane = vec4(0,1,0,-480);
gl_ClipDistance[0] = dot( M * vec4(vertex,1), plane);
gl_Position = MVP * vec4(vertex,1);
In my water.vertexshader, I performed necessary calculations to transform a local vertex: water.vertexshader:
// MVP_offset = P * V * M_offset, where M_offset depends on a vector of vecs2 passed in containing instancing offsets
clipSpace = MVP_offset * vec4(vertex,1.0);
gl_Position = MVP_offset * vec4(vertex,1.0); // instanced vertex
Then in my water.fragmentshader, I applied Blinn-Phong shading and sampled the reflection texture and projectively mapped it: water.fragmentshader:
// Sampler variable
uniform sampler2D waterTexture;
// Projectively map the reflection texture
vec2 clipProj = (clipSpace.xy / clipSpace.w) / 2.0 + 0.5;
clipProj.y *= -1.0f; // flip texture around
// waterTexture was assigned texture unit 0
vec4 finalVec = vec4(texture(waterTexture, clipProj).rgb, 1.0);
vec4 finalVec2 = finalVec * vec4(ambientComponent() + diffuseComponent(modelNormal,lightVec) + specularComponent(modelNormal, lightVec), 1.0);
FragColor = finalVec2;
c++ opengl
With my water render, I am having an issue, where based on the camera position and orientation, there is a "flicker" effect/problem on the terrain in the game. Basically, a gray overlay "flickers" onto the terrain, but then disappears. This repeats as the camera position/orientation is changed.
Specifically, it happens on only specific terrain "islands" and near the part of the terrain which intersects the water quad.
So, to illustrate the issue:
Water with no flicker
Water with flicker; In the bottom right hand side of the image, there is a slight gray overlay on the "small" island that protrudes from the main island.
Additionally, here is an animated .gif demonstrating the issue:
As a final note, this flickering does not happen, say, for the large body of terrain in the background.
Could anyone please let me know what additional details I need to provide, as well as point me in the right direction as to the problem and possible resolution?
Thank you in advance!
Below is my process of mapping the reflection to the water quad:
I first created one frame buffer object upon program start up:
Framebuffer Object Creation:
// FBO objct
unsigned int framebuffer;
glGenFramebuffers(1, &framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// generate texture
unsigned int texColorBuffer;
glGenTextures(1, &texColorBuffer);
glBindTexture(GL_TEXTURE_2D, texColorBuffer);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1024, 768, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, 0);
// attach it to currently bound framebuffer object
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texColorBuffer, 0);
unsigned int rbo;
glGenRenderbuffers(1, &rbo);
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 1024, 768);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo);
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
std::cout << "ERROR::FRAMEBUFFER:: Framebuffer is not complete!" << std::endl;
glBindFramebuffer(GL_FRAMEBUFFER, 0);
I created a single water quad:
// real_offsets needed for instancing
std::vector<glm::vec2> real_offsets;
real_offsets.push_back(glm::vec2(650, 450));
glm::mat4 waterQuad = glm::mat4(1.0f);
waterQuad = translate(waterQuad, vec3(0, 480.0, 0));
waterQuad = scale(waterQuad, vec3(100, 1, 100));
objects.push_back(std::shared_ptr <Object>(new Object("waterpane_very_low.obj", waterQuad, real_offsets, true, false
, glm::vec3(0.0, 0.5, 1.0))));
Then in the main game loop, I used the frame buffer object to save a snapshot of the scene:
Main Game Loop:
do {
glEnable(GL_CLIP_DISTANCE0);
// Use frame buffer object
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw scene with no water quad to FBO
// [...]
// Disable frame buffer object
glBindFramebuffer(GL_FRAMEBUFFER, 0);
// Save frame buffer object texture to texture unit 0 to use later
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texColorBuffer);
glDisable(GL_CLIP_DISTANCE0);
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw whole scene, including water quad as normal
// [...]
// Swap buffers
glfwSwapBuffers(window);
glfwPollEvents();
} while (glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS && glfwWindowShouldClose(window) == 0);
In my normal object's shader, I enabled a clip plane to control what is drawn to the reflection texture: NormalObjects.vertexshader:
const vec4 plane = vec4(0,1,0,-480);
gl_ClipDistance[0] = dot( M * vec4(vertex,1), plane);
gl_Position = MVP * vec4(vertex,1);
In my water.vertexshader, I performed necessary calculations to transform a local vertex: water.vertexshader:
// MVP_offset = P * V * M_offset, where M_offset depends on a vector of vecs2 passed in containing instancing offsets
clipSpace = MVP_offset * vec4(vertex,1.0);
gl_Position = MVP_offset * vec4(vertex,1.0); // instanced vertex
Then in my water.fragmentshader, I applied Blinn-Phong shading and sampled the reflection texture and projectively mapped it: water.fragmentshader:
// Sampler variable
uniform sampler2D waterTexture;
// Projectively map the reflection texture
vec2 clipProj = (clipSpace.xy / clipSpace.w) / 2.0 + 0.5;
clipProj.y *= -1.0f; // flip texture around
// waterTexture was assigned texture unit 0
vec4 finalVec = vec4(texture(waterTexture, clipProj).rgb, 1.0);
vec4 finalVec2 = finalVec * vec4(ambientComponent() + diffuseComponent(modelNormal,lightVec) + specularComponent(modelNormal, lightVec), 1.0);
FragColor = finalVec2;
c++ opengl
c++ opengl
edited Jan 4 at 9:57
Mo D1N
asked Jan 4 at 3:02
Mo D1NMo D1N
113
113
Details would include what your code is doing...
– immibis
Jan 4 at 6:53
1
@immibis Sorry, I've updated my post with the related code.
– Mo D1N
Jan 4 at 8:46
add a comment |
Details would include what your code is doing...
– immibis
Jan 4 at 6:53
1
@immibis Sorry, I've updated my post with the related code.
– Mo D1N
Jan 4 at 8:46
Details would include what your code is doing...
– immibis
Jan 4 at 6:53
Details would include what your code is doing...
– immibis
Jan 4 at 6:53
1
1
@immibis Sorry, I've updated my post with the related code.
– Mo D1N
Jan 4 at 8:46
@immibis Sorry, I've updated my post with the related code.
– Mo D1N
Jan 4 at 8:46
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54032616%2fopengl-4-6-game-program-water-reflection-flicker-problem%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54032616%2fopengl-4-6-game-program-water-reflection-flicker-problem%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Details would include what your code is doing...
– immibis
Jan 4 at 6:53
1
@immibis Sorry, I've updated my post with the related code.
– Mo D1N
Jan 4 at 8:46