Sign in to follow this  
xinvar

OpenGL Material and light settings for a human face

Recommended Posts

This is my first post here. I did many searches but didn't get any useful information. I believe people here would have already met this problem before so better ask. I am trying to use opengl material and lighting (simple enough) to give a triangle meshed human face a realistic look -- not necessarily that good, but at least look like a human being. I cannot use textures. I tried this manually for about 3 hours yesterday afternoon without luck. So if anybody could share with me this information I would appreciate very much.

Share this post


Link to post
Share on other sites
Is this an assignment? Why on earth couldn't or wouldn't you use textures? Plain old per vertex lighting and materials won't give you a very good effect unless your model is VERY HIGHLY tesselated and rendered in multiple passes. If strictly limited to ogl lighting and materials (no shaders or textures), I would play with the emissive light property a bit and maybe the accumulation buffer to kind of blur it a bit over multiple passes.

Good luck

J

Share this post


Link to post
Share on other sites
It's not an assignment. It's part of my research in visualizing DTI (diffusion tensor imaging) on human brain. The model I got from marching cube is VERY HIGHLY tesselated. I did play with emission lighting, and got some very cute nice looking rendering, but just doesn't look like a real human's face.
How to render it in multiple passes? I do know how to use accumulation buffer to make motion blur effects (had a published paper on this :-D), but not sure how to use that to make the rendering better.

Share this post


Link to post
Share on other sites
My thought was to use the accumulation buffer to blur the face slightly over multiple passes while giving the face a very slight emissive quality.

Here is a good example of the accumulation buffer usage over multiple passes to achieve depth of field. The same type of technique probably without the depth of field is what I had in mind. Scroll down to the "field.c".

I don't understand how you could have written a paper on an accumulation buffer blur effect and not know how to render multiple passes. That is the whole point of the accumulation buffer and I don't know how else or why else you could or would use it. Do you have a link to the paper you wrote? Sounds like an interesting read....

Share this post


Link to post
Share on other sites
Sorry I wasn't clear. Of course I know how to render multiple passes for motion blur, but don't know how to use this to achieve a face with nice make-up. Thanks for the link!

Share this post


Link to post
Share on other sites
Quote:
Original post by xinvar
I am trying to use opengl material and lighting (simple enough) to give a triangle meshed human face a realistic look -- not necessarily that good, but at least look like a human being. I cannot use textures.

I tried this manually for about 3 hours yesterday afternoon without luck. So if anybody could share with me this information I would appreciate very much.

With no texturing (or shaders) of some sort you can pretty much forget about it. Human skin is a highly complicated mixture of bumps and colours, coupled with fresnel effects that can vary across the surface, with transluency and sub-surface light scattering adding even more headache to the mix (to a degree the look of skin will depend on what's *under* it and 'behind' it)

You can check CG skin tutorial which goes indepth on what makes skin appear like skin, and how one might try to emulate it. Another file worth checking would be Steven Stahlberg's tutorial which also provide a handful of tips on what makes the skin 'skin-like'. (the latter is probably more useful since it goes more into how to 'fake' the skin appearance through less advanced means)

Share this post


Link to post
Share on other sites
Thank you tolaris. But I am not trying to create a skin that can give me a SIGGRAPH paper, just an okay looking would be it. Even the one in Matlab default MRI isosurface rendering would be fine. Besides, I don't want to spend days on this (not my research focus).

Actually, I have to say, the first (starting) image from Steven Stahlberg's tutorial is all I need, becaues in an MRI scan, everybody looks dead :-D

Share this post


Link to post
Share on other sites
Quote:
Original post by xinvar
Actually, I have to say, the first (starting) image from Steven Stahlberg's tutorial is all I need, becaues in an MRI scan, everybody looks dead :-D

^,^ in this case, if you can't use textures... you might want to try introducing some kind of fractal variation to base colour and specular strength, by adjusting slightly the 'base' values for individual vertices of the mesh? This can make quite a bit of difference in looks unless of course for some reason you can't use something like that, either...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Partner Spotlight

  • Forum Statistics

    • Total Topics
      627642
    • Total Posts
      2978354
  • Similar Content

    • By xhcao
      Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness. 
    • By cebugdev
      hi guys, 
      are there any books, link online or any other resources that discusses on how to build special effects such as magic, lightning, etc. in OpenGL? i mean, yeah most of them are using particles but im looking for resources specifically on how to manipulate the particles to look like an effect that can be use for games,. i did fire particle before, and I want to learn how to do the other 'magic' as well.
      Like are there one book or link(cant find in google) that atleast featured how to make different particle effects in OpenGL (or DirectX)? If there is no one stop shop for it, maybe ill just look for some tips on how to make a particle engine that is flexible enough to enable me to design different effects/magic 
      let me know if you guys have recommendations.
      Thank you in advance!
    • By dud3
      How do we rotate the camera around x axis 360 degrees, without having the strange effect as in my video below? 
      Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.
      Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.
       
      References:
      Code: https://pastebin.com/Hcshj3FQ
      The video shows the difference between blender and my rotation:
       
    • By Defend
      I've had a Google around for this but haven't yet found some solid advice. There is a lot of "it depends", but I'm not sure on what.
      My question is what's a good rule of thumb to follow when it comes to creating/using VBOs & VAOs? As in, when should I use multiple or when should I not? My understanding so far is that if I need a new VBO, then I need a new VAO. So when it comes to rendering multiple objects I can either:
      * make lots of VAO/VBO pairs and flip through them to render different objects, or
      * make one big VBO and jump around its memory to render different objects. 
      I also understand that if I need to render objects with different vertex attributes, then a new VAO is necessary in this case.
      If that "it depends" really is quite variable, what's best for a beginner with OpenGL, assuming that better approaches can be learnt later with better understanding?
       
    • By test opty
      Hello all,
       
      On my Windows 7 x64 machine I wrote the code below on VS 2017 and ran it.
      #include <glad/glad.h>  #include <GLFW/glfw3.h> #include <std_lib_facilities_4.h> using namespace std; void framebuffer_size_callback(GLFWwindow* window , int width, int height) {     glViewport(0, 0, width, height); } //****************************** void processInput(GLFWwindow* window) {     if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)         glfwSetWindowShouldClose(window, true); } //********************************* int main() {     glfwInit();     glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);     glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);     glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);     //glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);     GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", nullptr, nullptr);     if (window == nullptr)     {         cout << "Failed to create GLFW window" << endl;         glfwTerminate();         return -1;     }     glfwMakeContextCurrent(window);     if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))     {         cout << "Failed to initialize GLAD" << endl;         return -1;     }     glViewport(0, 0, 600, 480);     glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);     glClearColor(0.2f, 0.3f, 0.3f, 1.0f);     glClear(GL_COLOR_BUFFER_BIT);     while (!glfwWindowShouldClose(window))     {         processInput(window);         glfwSwapBuffers(window);         glfwPollEvents();     }     glfwTerminate();     return 0; }  
      The result should be a fixed dark green-blueish color as the end of here. But the color of my window turns from black to green-blueish repeatedly in high speed! I thought it might be a problem with my Graphics card driver but I've updated it and it's: NVIDIA GeForce GTX 750 Ti.
      What is the problem and how to solve it please?
  • Popular Now