Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Geomtery based lighting


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
6 replies to this topic

#1 D.V.D   Members   -  Reputation: 513

Like
0Likes
Like

Posted 26 February 2013 - 03:54 PM

I had this idea that Im sure has been implemented before, I wanted to make a lighting technique where you have a set of vertices and use those vertices as your light volume. For example, if you had a area light kind of like in the crysis 3 tech demo, you would have a box where one face of the box projects a light texture that won't go past the other side of the mesh. Im pretty sure one of the crysis 3 developer video's had this, but I was then wondering how you would go about defining which faces generate the light and I couldn't think of a way that would be easy to program without a predefined set of shapes. Does anyone know how I would go about doing something like this in OpenGL, C++?



Sponsor:

#2 HardlineDigital   Members   -  Reputation: 255

Like
2Likes
Like

Posted 27 February 2013 - 02:24 PM

I would recommend you download the Cryengine free SDK and look at the source code. I know exactly what you're talking about and I used it for the lights on the helipad I built. But I'm pretty sure there is no "easy to program" way of doing this.

 

It is really just a trick, the light is not coming from the surface. It is not well documented.

 

First I created a small object and textured it. I also painted some glow on the surface (incadescence) and then I created a light right in front of it. Then I used a shape to clip the light so it looks like it is coming from the glowing surface. The lightshape is linked to the light and the glowing surface is not actually emitting.

 

I hope this helps. Now I am late for class unsure.png

 

http://www.zbrushcentral.com/attachment.php?attachmentid=347274 



#3 Hodgman   Moderators   -  Reputation: 31781

Like
1Likes
Like

Posted 27 February 2013 - 03:58 PM

Many tutorials on deferred rendering will do this. The projected light texture is sometimes called a 'gobo'.

#4 InvalidPointer   Members   -  Reputation: 1443

Like
0Likes
Like

Posted 27 February 2013 - 09:43 PM

For clarification, is this calculating the effect of lighting *as emitted from the polygons* or just bounding an area of influence? If it's the former, you're in for one hell of a time trying to calculate all that analytically. If it's the latter, see Hodgman's post.


clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.

#5 HardlineDigital   Members   -  Reputation: 255

Like
0Likes
Like

Posted 27 February 2013 - 10:46 PM

Actually, now that I look at the question again. I think it is asking about two different lighting methods.

 

The projected light texture that Hodgman is talking about gives you similar, and probably way more control over the shape of the emission but is not the same as geometry clipping light shape. You would then be controlling the light shape with a texture instead of geometry. It works like a lot like a decal.



#6 D.V.D   Members   -  Reputation: 513

Like
0Likes
Like

Posted 28 February 2013 - 12:12 AM

Well i was thinking more along the lines of the light being controlled by the geometry and the volume inside the geometry is where the light is, not outside of the volume ( before the first bounce that is )

I guess you could say projected textures, i tried looking up what a gobo is and thats pretty much what i was looking for except that i only found real world examples, not any programmed or in engine versions. Is there a tutorial about how to do something like this? Im not really worried whether it is forward or deferred rendering since im doing this for an art project and having more control over the lights shape is a higher priority to me.

#7 Hodgman   Moderators   -  Reputation: 31781

Like
2Likes
Like

Posted 28 February 2013 - 12:30 AM

The projected light texture that Hodgman is talking about gives you similar, and probably way more control over the shape of the emission but is not the same as geometry clipping light shape. You would then be controlling the light shape with a texture instead of geometry. It works like a lot like a decal.

There's two main ways to apply lights in a deferred renderer -- either by screen-space quads that cover the screen-space area of the light, or by 3D geometry that covers the volume of the light. Any deferred rendering tutorial that uses the latter technique will teach you how to apply light only to areas inside a meshes volume using the stencil buffer. You can use any aribtray, closed mesh to apply the lighting if you wanted to.
No matter which lighting technique you're using (deferred with quads, deferred with volumes, forward...), you can also apply projected gobo texture as part of the same lighting effect.

Is there a tutorial about how to do something like this?

Googling "deferred rendering tutorial" and "projected texture tutorial" brings up a lot of hits.




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