Results 1 to 4 of 4

Thread: Size of the model: render time and light intensity

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2012
    Posts
    1

    Size of the model: render time and light intensity

    Hello everyone.

    For a OpenGL/JOGL application, I have a real-size model of an object. My model is a little big (it can be surrounded by a sphere of radius 3 meters). While working on this, couple of questions have puzzled my mind:
    • Does the size of the model has any effect on the render time? More precisely, if I scaled down my model by a factor of 0.01, am I going to have a faster render? (scaling down the model before importing and not using glScale)
    • Consider I'm brightening my scene with a light source which has a certain intensity. If I scale (up/down) my model, in order to obtain the same appearance, should I also scale my light intensity?

    Thanks in advance

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: Size of the model: render time and light intensity

    1. no, size does not have any effect on rendering speed, the size of how big it is on the screen might, but normally it shouldn't make that much of a difference.
    Scaling before also does not have any effect since you are still scaling/rotating/translating at render time.

    The only scaling you should do beforehand is to get the objects in the same scale as everything else, personally i make sure all objects use 1.0f = 1.0m

    2.no, but you will have to move the lights position in relation to the objects scaling to obtain the same appearance.

  3. #3
    Senior Member Regular Contributor remdul's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands
    Posts
    346

    Re: Size of the model: render time and light intensity

    zeoverlord isn't wrong, but to be pedantic...

    If you are using Fixed Function functionality (aka FFP) of OpenGL (pre GL2.0, no GLSL shaders), then scaling with glScalef will actually affect lighting because the normals (glNormal3f) will be scaled also. Calling glEnable(GL_NORMALIZE); at your application initialization will instruct OpenGL to automatically correct the normals' magnitude to compensate for this.
    And theory, this re-normalization might affect performance negatively, though negligible on all modern hardware. If you're not sure, GL_NORMALIZE will do no harm, so try it if lighting looks odd after scaling (excessively bright when scaling up, or darker when scaling down).

    There are situations where scaling does cause problems; floating point accuracy. Very large (or very small) floating point numbers may cause polygons to appear wobbly in relation to a moving camera viewpoint. So generally it is preferred to keep numbers in 0.0 to 1.0 range for optimal accuracy (but the 3.0 of your example just fine still!). Wikipedia has some more details: http://en.wikipedia.org/wiki/Floating_point
    Not really important for beginners, but awareness of the problem can be useful further down the road.

    As zeoverlord hinted at, please note that OpenGL is dimensionless. A "3m radius" doesn't particularly mean anything. OpenGL units are whatever you want them to be. I'll assume that you meant the number "3.0". Not a huge difference, but there's a subtle importance.

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2012
    Posts
    7

    Re: Size of the model: render time and light intensity

    One other point to consider is numerical accuracy and data precision range.

    If your app wanted to display both a model that is say 2 millimeters and a model that is 2 kilometers, then the data type of how you store this data becomes important and the data types used in OpenGL also become important.

Similar Threads

  1. how to render a model independently from the light source
    By jyoung77 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-10-2007, 02:48 PM
  2. light intensity
    By lesni_bleble in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-19-2004, 06:53 AM
  3. Light in real time render
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-16-2002, 04:54 AM
  4. light intensity, part 2 : physical intensity
    By Morglum in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 03-11-2002, 01:03 AM
  5. I need help ! light intensity
    By Morglum in forum OpenGL: Advanced Coding
    Replies: 12
    Last Post: 03-08-2002, 08:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean