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

Bug: PBR shader incorrectly gets lit by lights when viewmodel is drawn #993

Closed
Equalizer5118 opened this issue Nov 4, 2023 · 7 comments
Closed
Assignees
Labels
Includes Map! Type: Bug This is a problem with something that should be working one way, but isn't. What: Graphics Graphics-related stuff

Comments

@Equalizer5118
Copy link
Member

Describe the bug

The PBR shader does not light correctly when the ViewModel is drawn, producing vastly incorrect lighting. This effect is greatly amplified when using the light from the skybox when CSM does not exist.

It seems to be tied to the lighting of the ViewModel for some reason, as the color fading effect on the ViewModel also seems to affect the PBR materials:
https://github.com/StrataSource/Engine/assets/113145248/22c7c729-0a19-42ee-ba84-988a0cb6d4f2

Here are some example screenshots:
20231103200820_1
20231103200824_1
20231103200833_1
20231103200835_1
20231103201108_1
20231103201110_1
20231103201902_1
20231103201904_1

To Reproduce

  1. Open given map
  2. Walk into the sunlight
  3. Observe lighting difference
  4. Remove the cascade light ( ent_remove env_cascade_light )
  5. Walk into sunlight
  6. Observe bug

Then repeat this with the ViewModel disabled

Issue Map

pbr_light_test.zip

Expected Behavior

lighting should remain consistent when viewmodel interacts with

Operating System

Tested on Windows 11

@Equalizer5118 Equalizer5118 added the Type: Bug This is a problem with something that should be working one way, but isn't. label Nov 4, 2023
@Equalizer5118
Copy link
Member Author

Side note: There are a couple light_spot entities. That is intentional, I was testing to see if lighting bug works on those. For some reason, it does not

@MyGamepedia
Copy link

I highly recommend to share here your .VMT of your texture, there may be a problem with it. I came across very similar situation when I tried to use VertexLitGeneric for brushes.

@Equalizer5118
Copy link
Member Author

isnt vertexlitgeneric only supposed to be used with models?

@MyGamepedia
Copy link

no but your issue show similar results, I have an idea that you maybe just have problem in your vmt file.

@Equalizer5118
Copy link
Member Author

"PBR"
{
	$basetexture               "PBR/metal/wall_corrugated_white_main_basecolor"
	$bumpmap                   "PBR/metal/wall_corrugated_white_main_bump"
	$mraotexture               "PBR/metal/wall_corrugated_white_main_mrao"

	$envmap                    "env_cubemap"
	$normalmapalphaenvmapmask  1

	$parallax 1
	$parallaxcenter .73
	$parallaxdepth .13

	%NoPortal 1
}

Created straight from PBR-2-Source, with only the parallax params noportal flag being added

@ozxybox ozxybox added What: Graphics Graphics-related stuff Includes Map! labels Nov 5, 2023
@Equalizer5118
Copy link
Member Author

metal.zip

@JJL772 JJL772 self-assigned this Jan 30, 2024
@JJL772
Copy link
Member

JJL772 commented Feb 3, 2024

Fixed in staging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Includes Map! Type: Bug This is a problem with something that should be working one way, but isn't. What: Graphics Graphics-related stuff
Projects
None yet
Development

No branches or pull requests

4 participants