aod6060 / FirstPersonShooter

This is going to be a First Person Shooter game made from scratch
MIT License
1 stars 0 forks source link

Update Render 3 - Lighting and Material Systems #5

Closed aod6060 closed 9 years ago

aod6060 commented 9 years ago

Start working on a basic lighting system going. This means get a simple directional lighting working, plus point lighting, and a single spot light for a flash light. I'm going to derive the light from the micro facet equation. Here a link to an article about micro facet lighting. http://simonstechblog.blogspot.com/2011/12/microfacet-brdf.html

aod6060 commented 9 years ago

Here a small preview with pictures of what I've been doing with the lighting so far... Also to note I'm deriving my lighting system from the microfacet brdf equation.

lighting1

lighting2

lighting3

lighting4

These first few pictures show the scene with a really high roughness value. Roughness is calculated from 0.0 to 1.0 where 0.0 is the smooth and 1.0 is rough. When the roughness is set the 1.0 the reflection won't be visible. If 0.0 then it will show all reflections.

The next images demonstrates the roughness value at 0.1 with a fresnel value of 0.5. lighting5 lighting6 The next image show the fresnel term at 2.0 lighting7 The next 2 images show the specular highlight being dampens when looking in front of the object where by looking at the back the specular is intence. lighting8 lighting9 I'm still working on the lighting system but I made a little progress with it :)

aod6060 commented 9 years ago

One last update to tonight. I got multilights implemented. Here a few images of me playing with it for fun

lighting10

lighting11

lighting12

Time for some shut eye ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ!!!

aod6060 commented 9 years ago

I've got to the point were I think the light system is pretty much very useful to use for my project. I've got some pictures of the final product of my labor to show off :dancer:

lighting13 lighting14 lighting15

This next image I add in attenuation to both point lights and spot lights. I don't really need it for directional light because it is going to be used for just sun light. I will probably change that for later. lighting16

The last two images show case off gamma correction with the light system. I fixes a few things of making the lights a little brighter plus the scene just looks better. lighting17 lighting18

I think I'm at a point were I can pretty much close this issue for the milestone. At the moment the light system can only use 8 lights at a time. However, I can increase the size of this to use more than 8 lights, however, for now I will close this and get started on the next system which helps with the lighting the material system.

aod6060 commented 9 years ago

Uh... I need to add a few stuff to the light system that will help me with the material system. That is why I've reopening it.

aod6060 commented 9 years ago

I've decided to fuse the material and light system together because it seems appropriate.

aod6060 commented 9 years ago

Here a small show case of what the material system with the lighting system can do so far.

landm1

landm2

landm3

landm4

This next picture show a problem with the lighting system. I think it has something to do with the Fresnel term.

landm5

Oh well back to work...

aod6060 commented 9 years ago

I think I fixed the issue with the Fresnel term plus I've improved on the fidelity of the the light engine :). Here is some pictures of the final fix for the basic lighting for now. There are still a few inaccessories but I'll fix them later.

landm6

landm7

landm8

landm9

Here is the fixed the problem. landm10

Ok time to get back to work with the lighting system.

aod6060 commented 9 years ago

I wasn't able to get reflection working properly just yet. However, I did fix a few things with the main shader and I've decided to do changes to a separate shader for testing and once I get done with it, then I simply copy paste it into to main shader. All well I'll leave here with a nice picture.

landm11

aod6060 commented 9 years ago

Here a small update on the reflections stuff. The reason why I'm exploring reflection and refraction is that it is used for both metal materials and shiny materials. If the surface is shinny it should also reflect what the light is reflecting. The pictures I'm going to show are just tests for reflection and refraction. I'm uI'm using a simple skybox for the Cubemap which is a skybox I generated in terraingen.

Reflection landm12

Refraction landm13

As seen in the refracting one it kind of not working corrently for some reason. I'll have to look into it to see what is wrong. For now I'll just focus on reflection so I can do different types of materials including metals and diamm what ever that word is. Oh well ZZZZZZZZZzzzzzzzZZZ.

aod6060 commented 9 years ago

I'm not getting any where with this new lighting model. I've decided use a simpler lighting model so I can get a a nice game created. I'm going to use the good old lambers method for diffuse and blinn phong for this will be part of the next milestone.