Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:27:47+00:00 2026-06-06T10:27:47+00:00

I am writing a GLSL program as part of a plugin that runs inside

  • 0

I am writing a GLSL program as part of a plugin that runs inside of Maya, a closed-source 3D application. My plugin renders custom geometry into the same image buffer that the application renders it’s default polygonal geometry. The application uses the OpenGL fixed pipeline for it’s lighting and shading but I am using GLSL to render custom geometry and materials.

My problem is, I want to mimic the behavior of the fixed pipeline lights in my shader. The application defines the lights in the gl_LightSource uniform and I want them to have the same direction, intensity etc when assigned to my custom geometry that they have when assigned to the application’s default polygonal geometry.

The gl_LightSource fields are clearly documented but I cannot find definitive documentation of how the fixed-pipeline interprets those fields. There are many examples of how to code point/directional/spot lights in GLSL but they do not seem to exactly mimic the fixed pipeline. For example, how do you determine if a light is a point, directional or spot light if the application defines a mix of them? Can a mix of light types be handled without introducing excessive branching in my shader?

In short, is there any definitive documentation or example of how the fixed function pipeline evaluates gl_LightSource?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:27:48+00:00Added an answer on June 6, 2026 at 10:27 am

    My problem is, I want to mimic the behavior of the fixed pipeline lights in my fragment shader.

    Well there’s your first problem, because the “fixed pipeline lights” are implemented in the vertex processor, not per-fragment.

    In short, is there any definitive documentation or example of how the fixed function pipeline evaluates gl_LightSource?

    Yes. It’s called “The OpenGL Graphics System: A Specification.” It’s available for download on the OpenGL Registry; you want the compatibility profile. Section 2.13 of the 4.2 compatibility specification covers all of the math used for lighting. Simply translate that into GLSL code.

    Note that you’re not going to be able to exactly mimic the fixed-function pipeline. That is, there is no way to guarantee invariance between shader-based and fixed-function lighting.You’ll get something close, but not binary-identical values.

    Can a mix of light types be handled without introducing excessive branching in my shader?

    How do you define “excessive”? You’re going to need to branch, because OpenGL’s lighting equations involve conditional logic.

    That’s generally part of the reason why people don’t just re-implement GL’s lighting in a shader. You can be much more efficient if you just write GLSL, rather than using a data-driven approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a GLSL program as part of a plugin running inside of
I am writing a GLSL shader that simulates chromatic aberration for simple objects. I
I am writing a GLSL geometry shader and I am trying to use the
Writing a client application that sends images to a server via a webservice. As
I writing a JSP program that needs to react on an existing program. It
Writing my first silverlight application. I need to deliver some bitmap that the customer
Writing an application for a custom gallery, and all the script files are put
writing a server that runs on linux (Ubuntu) using mono. and a client that
Writing documentation in html requires some code examples. What to do with characters that
Writing a python program, and I came up with this error while using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.