Results 1 to 7 of 7

Thread: alternative to opengl lighting?

  1. #1
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    alternative to opengl lighting?

    Hi everybody!

    Is there any good alternative to OpenGL lighting. I know that there is per-pixel-lighting but most I found about it is:
    a) with bump-mapping (which I don't need at the moment)
    b) with register combiners (NVIDIA only, so what about supporting other cards)
    c) very, very, slow

    My development plattform is a 450MHz K6-2 with a GeForce2-MX running Linux. So is there any way to get good lighting on this or do I have to go the OpenGL lighting way with proper tesselation of my models?

    Any help is highly welcome!

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    Re: alternative to opengl lighting?

    why not bumpmapping.
    u can use dot3 (often refered to bumpmapping)
    this is very easy to use + works well on a gf2mx (far better than tessalating your model with more triangles + using opengl lighting)

  3. #3
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: alternative to opengl lighting?

    If you say it's fast enough i will give it a try.
    Any links to any good docs are welcome, too.

    I have read Ron Fraziers articles about per pixel lighting and think i understand the basic s. But since it's using register combiners it would be NVIDIA only .
    And is there any easy way to create a normal map?
    I think NVIDIA provide a photoshop plugin but that will not help me on Linux.

    thx for the advice

  4. #4
    Member Contributor
    Join Date
    May 2001
    Posts
    54

    Re: alternative to opengl lighting?

    Hey,

    Here is a method i tried with some success.

    Converted a bmp to greyscale in order to get heights for each pixel.

    Created triangles with a pixel and the 4 surrounding pixels. For example 1 triangle would be the pixel, the pixel directly above, and one to the side. From these three points, you can find the normal. This is where I fluffed a bit. The heights were scaled to [0,1]. I used 1 for the distance between each pixel. This enabled me to compute the cross product in order to get the normal for the triangle.
    So after that, you have 4 normals for 4 triangles. Average them and you have a normal for the pixel.

    Hope that helps

    J

  5. #5
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: alternative to opengl lighting?

    To Jeeeez: At least I understand it , thx

    Some other perhaps stupid question to the dot3 stuff:

    1) What shall I do with untextured Objects?
    I think there is no need for a normal map, since they have flat surfaces.

    2) Every Light = 1 pass, right?

    3) Does anyone know about any Demos (may be on Win I just want to look at the quality and perfomance) showing more than a simple cube and running with more than 10fps?

    And last but not least what I need the lighting for. I am working on a little engine to give non-opengl-coders the possibility to use 3d graphics in their apps (of course not in C/C++, cause I think they do not need just another engine and I am not good in them, too ). So I am trying to keep it very generic. I would like to have it usable for all kind of visualization tasks.
    So I am a little bit worried about the number of lights possible with dot3, types of lightsources, complexity of per vertex operations and many more
    But I just don't like OpenGLs lighting, 'cause I have to tesselate my objects even for diffuse lighting.

    Perhaps I should just dive into the dot3 stuff and try what I can do and then take another look, but any help on this trial and error is highly welcome.

    I think I should do more coding and less thinking (or was it the other way round?).

  6. #6
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    133

    Re: alternative to opengl lighting?

    Originally posted by satan:
    Hi everybody!

    Is there any good alternative to OpenGL lighting. I know that there is per-pixel-lighting but most I found about it is:

    My development plattform is a 450MHz K6-2 with a GeForce2-MX running Linux. So is there any way to get good lighting on this or do I have to go the OpenGL lighting way with proper tesselation of my models?

    Any help is highly welcome!
    Maybe I'm missing something here.. unless your looking for extrememly accurate lighting
    results the simplest way to simulate lighting
    is with a double pass. There are countless
    demos out there that show you haw to do it.

    Regards,
    Jim
    --
    Jim Mathies http://www.mathies.com/

    \"The best way to predict the future is to invent it."

  7. #7
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    374

    Re: alternative to opengl lighting?

    Originally posted by jmathies:
    Maybe I'm missing something here.. unless your looking for extrememly accurate lighting
    results the simplest way to simulate lighting
    is with a double pass. There are countless
    demos out there that show you haw to do it.

    Regards,
    Jim

    If it is just called double pass lighting then i just never heard of it.
    I do not look for very accurate lighting but for a more accurate lighting than OpenGL offers. I'd like to have ambient, diffuse, specular (the ambient should not be the problem) lighting without the need to tesselate my objects and I'd like to have spot lights and point lights, both with distance attenuation of some kind. And all I found was related to per pixel lighting (it is always an option for me to implement several lighting techniques and let the user decide which to use, but this would be of course more code to write and for my own apps i'd really like to have accurate lighting, if my HW can do it - and the per pixel stuff I have seen was very impressive).

Similar Threads

  1. Alternative to glFramebufferTexture for OpenGL version 3.1
    By tmason in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-13-2014, 06:19 AM
  2. Alternative to vertex texture fetch (OpenGL ES)
    By SiLiZiUMM in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 05-28-2012, 12:55 PM
  3. Lighting problem (opengl + shader lighting)
    By ox1d_47 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-19-2004, 09:43 PM
  4. OpenGL Alternative to X
    By nukem in forum OpenGL: Linux
    Replies: 13
    Last Post: 12-13-2003, 07:32 PM
  5. About lighting (not OpenGL lighting, but general lighting)
    By Anonymous Coward in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-04-2001, 09:10 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