Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specular speculation



> I've nearly finished the OpenGL support in our latest project.
> OpenGL support was added into an existing codebase which already
> supported RAVE and Direct3D....so all lighting and highlights were
> manipulated/supported directly.
>
> The problem I have now is that, from what I can see anyway,
> there's no way to use all my lighting pre-calcs and highlighting with
> OpenGL unless the separate specular extension is supported (someone
> PLEASE correct me if I'm wrong, I'd love to be wrong on this one).
> Assuming that's the case, what can I do?
>
> I'm using one directional light source and of course an ambient
> color and ambient light level. Obviously, those are supported in
> OpenGL and can be utilized without any problems. The problem I'm
> running into is with our water: I highlight the peaks manually. I
> don't see a way to pull this off through what's currently supported
> in the OpenGL/MacOS implementation.
>
> Am I out of luck on getting this to work without direct specular
> manipulation, or is there an alternative/hack?

The only thing that the GL_EXT_separate_specular_color extension does is
turn the equation

C = (A + D + S) * T

into the equation

C = (A + D) * T + S

where A, D, and S are the ambient, diffuse, and specular contributions, and
T is your texture map. You should be able to get specular highlights by
using standard OpenGL materials (see glMaterial, GL_SPECULAR, GL_SHININESS),
but your highlights will be modulated by your texture map.

-- Eric Lengyel


References: 
 >Specular speculation (From: "Eric A. Drumbor" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.