Jump to content

  • Log In with Google      Sign In   
  • Create Account


emittive light, add or multiply?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 cozzie   Members   -  Reputation: 1450

Like
0Likes
Like

Posted 17 March 2013 - 09:47 AM

Hi,

 

Probaly fairly simple question, but I'm curious what the 'right' way would be to add emittive light in my lighting 'system' (specified per material).


My first approach was multiplying the output pixel by the emittive light, but logically this gives no pixel color at all when there's no emission. So I figured adding the emittive light would be the trick. Works fine, but I doubt if this is 'the way' (maybe to much lit up?).

 

Here's what I've done now:

 

	float4 amb = (AmbientColor * AmbientIntensity * MatAmb) + MatEmm;
	float4 diff = (input.Color * MatDiff) + MatEmm;

// input.color is directional light outputted from the VS
// calculate point light etc., into att_total

	return saturate((diff + amb + att_total) * textureColor);

 

Just curious if this is the right way to approach this.

 

 



Sponsor:

#2 C0lumbo   Crossbones+   -  Reputation: 2120

Like
0Likes
Like

Posted 17 March 2013 - 12:49 PM

Adding the emissive colour makes sense. However, your code seems to add on the emissive twice (once to the ambient and once to the diffuse). I suggest you read up a little on the basic lighting model which it looks like you're trying to implement, this website looks like it offers a pretty good summary http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter05.html,



#3 cozzie   Members   -  Reputation: 1450

Like
0Likes
Like

Posted 17 March 2013 - 01:42 PM

Thanks, tutorial looks very good and readable/ understandable (first part read).

You're right, I'm adding emissive twice now, doesn't make sense to link it to specific lightsources. Looks better and to 'bright' now.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS