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

Ray-traced VC Textures #379

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft

Ray-traced VC Textures #379

wants to merge 46 commits into from

Conversation

jarmonik
Copy link
Contributor

@jarmonik jarmonik commented Jul 25, 2023

@n7275
Copy link
Contributor

n7275 commented Jul 25, 2023

Hi @jarmonik, regarding your "do not merge" comment, what we often do for NASSP dev, is leave PRs as "draft", until we're ready to merge them. Then we mark them as ready for review. That way they can't accidentally get merged early, but we can still use them as a placeholder for an ongoing project.

@jarmonik jarmonik added the enhancement New feature or request label Jul 26, 2023
@jarmonik jarmonik marked this pull request as draft July 26, 2023 12:13
jarmonik and others added 7 commits July 26, 2023 17:06
- Passed the data to a client level
- Addressed issue #379 (implemented but not tested)
- Cleared up filename and pathname confusion in D3D9Surface.cpp
- Cleared up visualization of shadow map (Debug)
…hader and are operational.

- Fixed bugs from IProcess.cpp
- Baked light sources can be adjusted from debug controls.
@jarmonik
Copy link
Contributor Author

This project is ready enough for shader development to start. Waiting feedback..

…edVC

# Conflicts:
#	OVP/D3D9Client/D3D9Util.h
@n7275
Copy link
Contributor

n7275 commented Jul 28, 2023

@jarmonik, what is needed for a test of this feature?

@jarmonik
Copy link
Contributor Author

There is currently nothing to test. The shader would need to be finished first. Felix24 knows how to build ray-traced textures and how to write shaders so he knows both sides of the equation. I don't know who else could do that. I suppose I could try to write some kind of shader but I have close to zero experience with 3D modeling and ray-tracing, so, I am not going to make any textures. It's a holiday season so it might take some time until things move forward. Meanwhile I try to improve the sun shadow quality.

@jarmonik
Copy link
Contributor Author

jarmonik commented Sep 9, 2023

Felix24 might be better qualified to answer the question but based on my understanding it would be just baked lights and sunlight. Support for dynamic local lights is already there but it's unknown if the shader will use them. But I suppose that dynamic lights could still be used to lit dynamic objects inside the cockpit like a floating object of some sort. Even if the dynamic lights wouldn't effect on a baked mesh.

We probably should add some kind of ambient light probe in the cockpit to detect the amount of sunlight shining through windows which would then dynamically increase the ambient light level inside the cockpit. It's not great if the cockpit is totally dark even if sunlight is coming in from a window. Some shaders should also include the local lights in addition to sunlight.

@n7275
Copy link
Contributor

n7275 commented Sep 16, 2023

Felix24 might be better qualified to answer the question but based on my understanding it would be just baked lights and sunlight. Support for dynamic local lights is already there but it's unknown if the shader will use them. But I suppose that dynamic lights could still be used to lit dynamic objects inside the cockpit like a floating object of some sort. Even if the dynamic lights wouldn't effect on a baked mesh.

We probably should add some kind of ambient light probe in the cockpit to detect the amount of sunlight shining through windows which would then dynamically increase the ambient light level inside the cockpit. It's not great if the cockpit is totally dark even if sunlight is coming in from a window. Some shaders should also include the local lights in addition to sunlight.

I am so bad at remembering to reply to things. I will reach out on the forum.

I like the idea of the ambient light probe. It's amazing just how bright the sun is, from a lighting standpoint: https://www.flickr.com/photos/projectapolloarchive/21315590814/in/album-72157659042210300/

Who else has written shaders in the past?

@Jordan-64
Copy link

Felix24 might be better qualified to answer the question but based on my understanding it would be just baked lights and sunlight. Support for dynamic local lights is already there but it's unknown if the shader will use them. But I suppose that dynamic lights could still be used to lit dynamic objects inside the cockpit like a floating object of some sort. Even if the dynamic lights wouldn't effect on a baked mesh.
We probably should add some kind of ambient light probe in the cockpit to detect the amount of sunlight shining through windows which would then dynamically increase the ambient light level inside the cockpit. It's not great if the cockpit is totally dark even if sunlight is coming in from a window. Some shaders should also include the local lights in addition to sunlight.

I am so bad at remembering to reply to things. I will reach out on the forum.

I like the idea of the ambient light probe. It's amazing just how bright the sun is, from a lighting standpoint: https://www.flickr.com/photos/projectapolloarchive/21315590814/in/album-72157659042210300/

Who else has written shaders in the past?

I think the photo from Flickr has a longer exposure time, you can see that because the camera was moved while taking the photo.

@colinmcglothlin
Copy link

We probably should add some kind of ambient light probe in the cockpit to detect the amount of sunlight shining through windows which would then dynamically increase the ambient light level inside the cockpit. It's not great if the cockpit is totally dark even if sunlight is coming in from a window. Some shaders should also include the local lights in addition to sunlight.

This is a good idea, and is basically what I'm trying to do. I currently grab the blue channel of gSun.Color as a proxy for the amount of sunlight present in the VC and use it to change the brightness of the ambient light illumination. gSun.Color is white in day and black at night, with some sunrise/sunset color mixing in between. I grab the blue channel because it is the last channel to increase in brightness at sunrise, and the first to decay at sunset, and allows for a more gradual transition between dynamic range regimes.

This does not take into account flying upside-down with the sun not visible through the windows. In this case, currently there is no change in the ambient light.

I want be able eventually to have multiple ambient light maps for sunlight coming from different directions. One with the light coming in from the forward direction, one for each side, and one for above.

@colinmcglothlin
Copy link

hi @jarmonik will this feature support local light sources in the VC as well as the baked lightmaps and sunlight?

This is a great idea. I'm not sure how to implement and test this though.

@jarmonik
Copy link
Contributor Author

I want be able eventually to have multiple ambient light maps for sunlight coming from different directions. One with the light coming in from the forward direction, one for each side, and one for above.

That sounds like a good idea, no need for the ambient probe. If there is an ambient map for each of the main directions (X,Y,Z) and -(X,Y,Z) then the ambient map could be interpolated from the main axes for a given sun light direction. If that's the way to go then I can add the texture load and interpolation procedures.

@jarmonik jarmonik linked an issue Jan 11, 2024 that may be closed by this pull request
@jarmonik
Copy link
Contributor Author

The C++ side should be now in a working condition. The shaders still need some work. Feedback required regarding fully baked configuration.

Ambient light probe experiment was successful, although, without HDR the small difference between dim local light and sun light causes some issues. With HDR upgrade, performance optimizations and quality improvements, this can work. With this upgrade it would be possible to block Earth glow coming in a closed payload bay.

It might be good idea to wait for the release of Orbiter 2024 before merge and then start updating the stock vessels since no more DX7 compatibility is required.

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.

[D3D9] Missing Legacy DX7 Shader Raytraced VC textures with panel lights Independent advanced textures
4 participants