Jump to content
  • Advertisement
Sign in to follow this  
emruiz81

OpenGL 3DMax like target spot lights in OpenGL

This topic is 4427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everybody. I'm trying to implement a derived light class in my engine, which uses a "Target spot light" style like 3D MAX's ones. Is it posible to make something like that by using OpenGL (or at least D3D?). I know those API doesn't include native support for this technique, but perhaps someone has developed some code to deal with it :) Thanks for your help/comments/suggestions.

Share this post


Link to post
Share on other sites
Advertisement
I'm not familiar with Max's implementation, but based on the name I wouldn't imagine you'd have any problems. It's the "area light" category that tend to be very hard to implement in real-time and/or D3D.

Although, you do need to make your mind up - You've posted in the DirectX forum with a subject line specifying OpenGL and your message seems to suggest you don't really mind...??

If you want an OpenGL specific answer, I can move this thread over to GDNet's OpenGL specific forum.

Alternatively, if you want a Direct3D specific answer then some more information would be useful - which language, which version of D3D, using shaders or fixed function?

Help us help you [wink]
Jack

Share this post


Link to post
Share on other sites
Well, thanks for your quick response!!
OK, actually I'm working in an OpenGL implementation. But I'm trying to keep an abstract architecure, because I'm planning to implement a D3D driver too. At this moment, the only thing I want to know is if someone knows a technic to do this (D3D or OpenGL... after I get the idea, I just have to port it :) ).
Anyway, I prefer an OpenGL orientation, as I'm working on it. Please, I'm new at this forums, so if you can move this to the GL world, I'll really apreciate!.

Perhaps projective textures are the solution to my question... but as I'm not familiar with it, I can't be sure about.
Thanks in advance!

Share this post


Link to post
Share on other sites
Quote:
Original post by emruiz81
Please, I'm new at this forums, so if you can move this to the GL world, I'll really apreciate!
Done [smile]

Quote:
Original post by emruiz81
OK, actually I'm working in an OpenGL implementation. But I'm trying to keep an abstract architecure, because I'm planning to implement a D3D driver too.
<--snip-->
Perhaps projective textures are the solution to my question... but as I'm not familiar with it, I can't be sure about.
I can't comment on OpenGL's features but Direct3D does have a fixed-function spotlight. Whilst it does technically do the job its fairly limited (hence the fixed-function [wink]). If you want a more complex solution then shaders are the way forward. You don't have to implement it as a projective texture - you could quite easily implement it in a vertex shader and work from there. However, projective textures could allow you more freedom - simple things like having shapes rather than spots (e.g. project a logo/symbol) and potentially more complex fall-off patterns...

I don't have them to hand, but I'm very sure one (or more) of the Game Programming Gems books had an implementation of a shader based spotlight. I'd imagine newer books like ShaderX and/or GPU Gems might cover this as well.

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!