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 8836601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:32:01+00:00 2026-06-14T09:32:01+00:00

I am curioust about one theme: Say that I have complex scene and one

  • 0

I am curioust about one theme: Say that I have complex scene
and one light, I can draw scene in parts by sending draw commands
sequentuially (for example in 100 steps).

Can I move the light between sequential calls ? For example i
would draw table vith light0 close to it then move light0 to
wall then draw wall then move light0 to chair then draw chair.
It would be then somewhat like assembly of it all It is legal
ot it will not work and each whole frame should have one light in
one position? (Same question would also be for other attributes )
tnx

  • 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-14T09:32:02+00:00Added an answer on June 14, 2026 at 9:32 am

    Of corse you can. Light position is just a variable that you pass to object shader like this:

    uniform vec4 fvAmbient;
    uniform vec4 fvSpecular;
    uniform vec4 fvDiffuse;
    uniform float fSpecularPower;
    
    uniform sampler2D baseMap;
    
    varying vec2 Texcoord;
    varying vec3 ViewDirection;
    varying vec3 LightDirection; <------  here is your light position
    varying vec3 Normal;
    
    void main( void )
    {
       vec3  fvLightDirection = normalize( LightDirection );
       vec3  fvNormal         = normalize( Normal );
       float fNDotL           = dot( fvNormal, fvLightDirection ); 
    
       vec3  fvReflection     = normalize( ( ( 2.0 * fvNormal ) * fNDotL ) - fvLightDirection ); 
       vec3  fvViewDirection  = normalize( ViewDirection );
       float fRDotV           = max( 0.0, dot( fvReflection, fvViewDirection ) );
    
       vec4  fvBaseColor      = texture2D( baseMap, Texcoord );
    
       vec4  fvTotalAmbient   = fvAmbient * fvBaseColor; 
       vec4  fvTotalDiffuse   = fvDiffuse * fNDotL * fvBaseColor; 
       vec4  fvTotalSpecular  = fvSpecular * ( pow( fRDotV, fSpecularPower ) );
    
       gl_FragColor = ( fvTotalAmbient + fvTotalDiffuse + fvTotalSpecular );
    
    }
    

    Its a shader with texture and one infinitely distant poin light.

    If you need to move a light source between objects render its easy like changing variable value.

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

Sidebar

Related Questions

This question is related to one of my others about C: What can you
One of the great things about LINQ is that allows you to get information
Let's say I have my vision and now my product backlog of items. That
Lets say we have a bunch of numbers that increment in small values from
Simple question, but one that I've been curious about...is there a functional difference between
Just curious. Say I have a Base entity and I'm deriving about 10 different
Just curious about this, I have one server our dev where a ridiculous amount
I'm curious about the ScreenSplitr app for jail-broken iPhones. This app allows one to
I was curious as to how does one go about finding undocumented APIs in
Curious about running multiple xvfb displays: I have between 10-50 instances of a script

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.