StrataSource / Engine

Issue tracker for Strata Source
47 stars 2 forks source link

Bug: PBR shader always shows "effects/flashlight001" texture from projectedtextures even if other spotlight texture is set, or $flashlighttexture is set to a different texture #1012

Open Equalizer5118 opened 11 months ago

Equalizer5118 commented 11 months ago

Describe the bug

The PBR shader always shows the "effects/flashlight001" texture from env_projectedtexture, even if the projectedtexture specifies a different spotlight texture https://github.com/StrataSource/Engine/assets/113145248/056ed3d4-7594-48da-baf1-8619ff7a36ee In this example, I have 6 env_projectedtextures parented to !player that has effects/flashlight005 (a custom texture I created) set as their spotlight texture. When shining on any other material shader, it renders the correct texture, however PBR renders flashlight001. Even if $flashlighttexture is set to any other flashlight texture in the material's VMT file, it will still always show as flashlight001.

According to the shader parameter file I was given a while ago ( https://discord.com/channels/663715905267564564/727657351800160287/1136697099006791792 ), $flashlighttexture does exist on the PBR shader, however if this is no longer the case that would explain why it does not work anymore.

To Reproduce

  1. Open provided map
  2. move to the dev textured wall, and observe the correct texture
  3. move to the PBR textured wall, observe bug

Issue Map

pjt_pbr_test.zip (also includes any custom files that were used. )

Expected Behavior

When viewing the PBR material, the texture drawn should be effects/flashlight005

Operating System

Tested on Windows 11

JJL772 commented 11 months ago

$flashlighttexture does exist on the PBR shader, however if this is no longer the case that would explain why it does not work anymore.

It does exist, it's one of the implicitly defined shader parameters like $color $basetexture, etc. The code was handling it improperly and forcing it to some other texture value.