Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Textures can't get brighter than their source image

  1. #1
    Junior Member Newbie kevinfishburne's Avatar
    Join Date
    May 2012
    Location
    Stone Mountain, GA, USA
    Posts
    25

    Textures can't get brighter than their source image

    I posted about this before (https://www.opengl.org/discussion_bo...-source-images) and ended up implementing a workaround, but would like to know a better way. The same question was posted here by someone else but is outdated:

    https://www.opengl.org/discussion_bo...Brighter-light

    The workaround for me was to set TEXTURE_ENV to COMBINE, set RGB_SCALE_ARB to two, then halve the intensity of all light sources.

    To elaborate on the subject, the amount of light applied to geometry appears to be clamped to the RGB values of the texture source image independent of material values used for color tinting. Bright lights "wash out" geometry so it appears ambiently-lit. Ideally a bright light near geometry should wash it out to white (supersaturate it). Here's an animated gif of an exploding ship being effected by the problem:

    http://eightvirtues.com/misc/Lighting.gif

    To confirm, is this behavior normal? If it is normal, other than resorting to shaders, is there a better way to circumvent it? Thanks, and apologies if the workaround is still the best solution outside of using shaders.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,528
    Quote Originally Posted by kevinfishburne View Post
    To confirm, is this behavior normal?
    Yes.

    In the fixed-function pipeline, vertex colours are clamped to (1,1,1). This is a limitation of most early 3D-capable hardware.

    Quote Originally Posted by kevinfishburne View Post
    If it is normal, other than resorting to shaders, is there a better way to circumvent it?
    "Better" is subjective. E.g. even scaling light intensities by a factor of two, texture colours below 0.5 won't saturate at full lighting intensity. There is probably a way around that using multi-texturing (adding 2*intensity-1.0 to the modulated texture colour). But there aren't many tutorials or examples regarding multi-texturing; by the time that support for it became widespread, it was being superseded by shaders. Or you could just perform a separate additive lighting pass without textures to handle super-saturation.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •