Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualmetsfan

Posted 05 June 2013 - 05:23 PM

First of all I want to mention that it's FPS game.

I don't know how many light I will be having in the scene, it depends on the game mission, but I expect many different lights.

For example: I could have 30-40 light in a scene as well as multiple lights affecting many meshes, rendering each mesh 30-40 times is just a total waste of performance.


Lights are additive, so you loop through all lights in the shader and add the outgoing irradiance values for each light. You should read up on lighting and BRDFs if you are serious about having 30-40 lights in a scene.

On a separate note, if you are serious about trying to build a first person shooter game, you are going about it the completely wrong way. Gamedev.net is a great place to ask questions when you already have some idea of what you want, but if you just come in here and ask for code without really a question, you come off as lazy. Then you come here with every single error you receive for code you didn't write, instead of taking some initiative and trying to figure it out on your own. That is why you have received so many downvotes for this thread. There are many resources for learning how to do proper lighting, and shader programming.

If you are serious about learning graphics programming, I highly recommend this book:
http://www.amazon.com/Real-Time-Rendering-Third-Edition-Akenine-Moller/dp/1568814240/ref=sr_1_1_bnp_1_har?ie=UTF8&qid=1370474265&sr=8-1&keywords=real+time+rendering

That's just one of many books you will need if you want to be a graphics programmer.

Best of luck, I hope you soon come to realize that this is the absolute wrong way to ask for help.

Edit - On another note, have you asked yourself whether you even want to be doing the graphics yourself? Consider using an engine that already has done the lighting stuff for you.

#2metsfan

Posted 05 June 2013 - 05:23 PM

First of all I want to mention that it's FPS game.

I don't know how many light I will be having in the scene, it depends on the game mission, but I expect many different lights.

For example: I could have 30-40 light in a scene as well as multiple lights affecting many meshes, rendering each mesh 30-40 times is just a total waste of performance.


Lights are additive, so you loop through all lights in the shader and add the outgoing irradiance values for each light. You should read up on lighting and BRDFs if you are serious about having 30-40 lights in a scene.

On a separate note, if you are serious about trying to build a first person shooter game, you are going about it the completely wrong way. Gamedev.net is a great place to ask questions when you already have some idea of what you want, but if you just come in here and ask for code without really a question, you come off as lazy. Then you come here with every single error you receive for code you didn't write, instead of taking some initiative and trying to figure it out on your own. That is why you have received so many downvotes for this thread. There are many resources for learning how to do proper lighting, and shader programming.

If you are serious about learning graphics programming, I highly recommend this book:
http://www.amazon.com/Real-Time-Rendering-Third-Edition-Akenine-Moller/dp/1568814240/ref=sr_1_1_bnp_1_har?ie=UTF8&qid=1370474265&sr=8-1&keywords=real+time+rendering

That's just one of many books you will need if you want to be a graphics programmer.

Best of luck, I hope you soon come to realize that this is the absolute wrong way to ask for help.

Edit - On another note, have you asked yourself whether you even want to be doing the graphics yourself? Consider using an engine that already has done the lighting stuff for you.

#1metsfan

Posted 05 June 2013 - 05:21 PM

First of all I want to mention that it's FPS game.

 

I don't know how many light I will be having in the scene, it depends on the game mission, but I expect many different lights.

 

For example: I could have 30-40 light in a scene as well as multiple lights affecting many meshes, rendering each mesh 30-40 times is just a total waste of performance.

 

Lights are additive, so you loop through all lights in the shader and add the outgoing irradiance values for each light.  You should read up on lighting and BRDFs if you are serious about having 30-40 lights in a scene.  

 

On a separate note, if you are serious about trying to build a first person shooter game, you are going about it the completely wrong way.  Gamedev.net is a great place to ask questions when you already have some idea of what you want, but if you just come in here and ask for code without really a question, you come off as lazy.  Then you come here with every single error you receive for code you didn't write, instead of taking some initiative and trying to figure it out on your own.  That is why you have received so many downvotes for this thread.  There are many resources for learning how to do proper lighting, and shader programming.

 

If you are serious about learning graphics programming, I highly recommend this book:

http://www.amazon.com/Real-Time-Rendering-Third-Edition-Akenine-Moller/dp/1568814240/ref=sr_1_1_bnp_1_har?ie=UTF8&qid=1370474265&sr=8-1&keywords=real+time+rendering

 

That's just one of many books you will need if you want to be a game programmer.

 

Best of luck, I hope you soon come to realize that this is the absolute wrong way to ask for help.  


PARTNERS