Skip to content

New demo: light #52

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

Merged
merged 6 commits into from
May 21, 2021
Merged

New demo: light #52

merged 6 commits into from
May 21, 2021

Conversation

pezcode
Copy link
Contributor

@pezcode pezcode commented May 20, 2021

Small demo that showcases how to render to an offscreen framebuffer and sample from it. It's doing 'deferred shading', but the actual lighting pass is just done in a single fullscreen draw. A proper renderer would be rendering light geometry impostors or use tiling/clustering, but this is a demo so 🤷

Lighting code uses basic normal mapping and PBR shading, most of it adopted from old code of mine. References/sources are provided where possible. I also did some very minor cleanup/convenience fixes I found useful while working on this, feel free to cherry pick whatever you like/don't like.

And a screenshot:
screenshot

It's default res unlike the other demo screenshots, so feel free to take a better one.

@pezcode
Copy link
Contributor Author

pezcode commented May 20, 2021

CI seems to die on index being ambiguous, not entirely sure what's happening there. I've only tested this on MSVC 2019 👀

@pezcode
Copy link
Contributor Author

pezcode commented May 21, 2021

Also, feel free to use other models/textures or change the lights if this is too bland. I just wanted to keep things minimal while programming.

@TheLavaBlock
Copy link
Member

Excellent! 👍 LGTM

I would like to undo cc7009f and set the related call in the example for the frame index to 0

And yeah, this index build error is weird. I put the lava namespace in front of it.

I'll take a closer look at the code over the next few days, maybe I'll have another idea or two. For example, we could offer a few parameters for the lights with imgui - Let's see, if you think of something, let me know 💡

Will do the PR first and then adjust some things...

@TheLavaBlock TheLavaBlock merged commit de5846d into liblava:master May 21, 2021
@pezcode
Copy link
Contributor Author

pezcode commented May 21, 2021

Some UI-controllable settings would be nice indeed. Random ideas:

  • roughness multiplier
  • diffuse color (current just white)
  • metallic
  • toggle normal mapping
  • light color(s)
  • light position(s), maybe along a predefined line/arc to make it simpler

A proper mesh might be useful as well, since I realized that my hack for inverting normals for double-sided materials breaks the normal-mapping code because of flipped UVs.

@TheLavaBlock TheLavaBlock added the enhancement New feature or request label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants