-
Notifications
You must be signed in to change notification settings - Fork 62
Mark lightMappingMaterial shaders for building correctly #1781
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
base: master
Are you sure you want to change the base?
Conversation
pStage->materialProcessor( &material, pStage, surface ); | ||
|
||
if ( material.enableSpecularMapping ) { | ||
/* This will get the non-reflective version of the material if reflection mapping is enabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't cubemaps being unavailable give you the version with specular mapping enabled but reflective specular disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah? Reflective specular isn't used if there are no cubemaps available, so I'm not sure what the question is here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, I thought there would be a compile option for enable specular but there isn't.
But in any case, the branch doesn't work for me. If I load Parpax with reflection mapping enabled, I get about 5 single shader builds after running buildcubemaps
either with this branch or on master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work correctly now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not working on my end - with the test in the previous comment I get the same results. The variants with reflective specular enabled are not pre-built.
eb32ff8
to
9feb755
Compare
9feb755
to
667222f
Compare
Context for |
Because it's dereferencing a nullptr/random garbage. |
Oh right the iterator is not valid. It's supposed to say |
I think I may have tested it wrong the previous time (without material system). I tested again and it does reduce the amount of lazily built shaders when cubemaps are not built. So the shader building commit LGTM. |
So to merge this I guess the |
#1810 fixes the wrong assert. |
This marks shaders correctly for materials that have specular w. r. t. reflection mapping settings.