Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added shadow support + lots of refactoring related to camera, lights and lighting #17

Merged
merged 60 commits into from
Oct 15, 2018
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
6a57f3e
Depth render target
asny Oct 12, 2018
d9b170b
Rename
asny Oct 12, 2018
c165fcc
Shadow cast begin
asny Oct 12, 2018
36918bf
Fix in shadow_cast_begin
Oct 12, 2018
6b981b3
Rename Camera -> PerspectiveCamera
Oct 12, 2018
5c3f2ce
Added Camera trait
Oct 12, 2018
6df52cd
Using camera trait when moving the camera
Oct 12, 2018
9f38491
Clean-up
Oct 12, 2018
d4a6518
Rename
Oct 12, 2018
7a06783
Added ShadowCamera
Oct 12, 2018
e602d28
Made width/height private in pipeline
Oct 12, 2018
ae149c2
Clean-up
Oct 12, 2018
74b109b
Added screen struct
Oct 12, 2018
d5a7e0d
Removed screen width/height from camera
Oct 12, 2018
c654ac7
set_target_screen_size
Oct 12, 2018
45c3bd5
Clean-up
Oct 12, 2018
4b203da
Replaced set_target_screen_size with set_aspect
Oct 12, 2018
146c9fb
Moved z-near and z-far from base camera to perspective camera
Oct 12, 2018
8a7885a
Closer to working shadows
Oct 12, 2018
82cd54f
Moved shadow_cast_begin to light
Oct 12, 2018
0533bfb
Sending shadowMap to the shader
Oct 12, 2018
56edcce
simplified shadow_cast_begin
Oct 12, 2018
8eb6143
Rename ShadowCamera to OrthographicCamera
asny Oct 12, 2018
40cc899
Setting states on default objects
asny Oct 12, 2018
68bc7fd
Transpose bias matrix
asny Oct 12, 2018
935d11e
Clean-up in wireframe example
asny Oct 12, 2018
ae877d9
Clean-up
asny Oct 12, 2018
f335d33
Saving surface parameters in g-buffer
asny Oct 15, 2018
5ed8342
Shadows in lighting example
Oct 15, 2018
494457a
Hard shadows
Oct 15, 2018
b9f6662
Changed lighting calculations
Oct 15, 2018
ed8ce21
Surface parameters are uniforms
Oct 15, 2018
7515ced
Only apply shadows if enabled on light
Oct 15, 2018
a25849b
Clean-up in light
Oct 15, 2018
1efe3b4
Fix wireframe example
Oct 15, 2018
aae5d98
Using triplanar mapping instead of uv coordinates
Oct 15, 2018
28a7026
Combine color and texture shaders
Oct 15, 2018
8c8c371
Clean-up (combined color and texture shaders)
Oct 15, 2018
f62a13f
Fix flickering of skybox
Oct 15, 2018
0d2baf3
Fix wireframe rendering
Oct 15, 2018
17d1a15
Normalize direction when creating directional light
Oct 15, 2018
ef33c80
Clean-up in light
Oct 15, 2018
11b4233
Ambient light is a light of its own
Oct 15, 2018
4e0639b
Clean-up
Oct 15, 2018
0bd5238
bugfix in light_pass
Oct 15, 2018
de6fb75
Clean-up in light pass
Oct 15, 2018
482c8ca
Added ambient light to lighting example
Oct 15, 2018
5ee6c0e
Possible to change surface parameters in lighting example
Oct 15, 2018
79ef7c6
Possible to change light parameters in lighting example
Oct 15, 2018
c951551
Setting parameters in wireframe example
Oct 15, 2018
d5b96ee
Major refactor of camera
Oct 15, 2018
51b4a09
Set up direction of camera
Oct 15, 2018
5b507de
Do not sample outside of shadowmap (no shadows outside)
Oct 15, 2018
2330127
Fix examples
Oct 15, 2018
4c95a6c
Fix seam in skybox
Oct 15, 2018
d87f2f6
Rename
Oct 15, 2018
8ce780f
Added vertex visualisation default
Oct 15, 2018
87da9f6
Possible to scale vertices
Oct 15, 2018
f36ef41
Use sphere instead of icosahedron for vertex visualisation
Oct 15, 2018
92d900e
Decreased the size of the vertices
Oct 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean-up
  • Loading branch information
Asger committed Oct 15, 2018
commit 4e0639b6e735b4822dfc7abf782507a800e94011
19 changes: 0 additions & 19 deletions src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,6 @@ impl DeferredPipeline
Ok(())
}

/*pub fn shadow_cast_begin(&self, light: &light::DirectionalLight) -> Result<(), Error>
{
if let Some(ref rendertarget) = light.shadow_render_target
{
rendertarget.bind();
rendertarget.clear();

state::depth_write(&self.gl,true);
state::depth_test(&self.gl, state::DepthTestType::LEQUAL);
state::cull(&self.gl,state::CullType::BACK);
state::blend(&self.gl, state::BlendType::NONE);
}
else {
return Err(Error::ShadowRendertargetNotAvailable {message: format!("Trying to cast shadows with no shadow render target available")} )
}

Ok(())
}*/

pub fn light_pass_begin(&self, camera: &camera::Camera) -> Result<(), Error>
{
match self.light_pass_rendertarget {
Expand Down