Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Light class for Directional or Point light #11

Open
cpadilla opened this issue Aug 23, 2019 · 0 comments
Open

Create a Light class for Directional or Point light #11

cpadilla opened this issue Aug 23, 2019 · 0 comments

Comments

@cpadilla
Copy link
Member

cpadilla commented Aug 23, 2019

At the time of this writing, I'm about to commit a change to the normal fragment shader where I use the w component of the light direction vector to determine if the light is a directional or point light.

If the w component is 0, the light is a directional light.

If the w component is 1, the light is a point light.

This task is to create a simple default base class for lights (subclasses DirectionalLight and Point Light), which easily create a directional light (and set the w component) or a Point light which uses an empty object model (optional) and the point lights location as the lights direction vector. If an object model is provided, then that object will "glow" and act as the light source. "Glow" value can be a slider or something.

EDIT: Additionally, we want to be able to set the constant, linear, and quadratic values of the light as described by https://learnopengl.com/Lighting/Light-casters.

cpadilla added a commit that referenced this issue Aug 23, 2019
…e w component to determine if a light is a directional light or a point light
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant