-
Notifications
You must be signed in to change notification settings - Fork 402
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
Attribute directive usage #34
Comments
Yep, that functionality is gone in pbrt-v4. It was basically a combination of it adding a fair amount of code complexity in return for not being used very much. (Never at all in the scenes I've got..) (Happy to consider adding it back if you or anyone else cares!) |
I cared and thought it was a useful feature because -
Some of the more tangible benefits comes when dealing with very large number of Shapes, for example: hair, grass, leaves, or spheres in a gumball machine. In cases like these overrides allow for-
That said, on the exporter side allowing for the overrides ended up being the most convoluted aspect of the design and part of me is eager to simplify (hence the question above). =] |
On PrimVars: yeah, it would be nice to have more about that. Though FWIW pbrt never even supported arbitrary per-vertex attributes that were interpolated before being used during shading--it was just uniforms, textures or the somewhat oddball BilerpTexture, which is gone in v4. The overrides it did support were implemented by taking care of them during parsing and creating a whole new material instance rather than having a more flexible material interface that allowed overrides and then figured out the right thing at runtime, which probably would have been a better example to set. Now, there is one piece of good news: there's a new
Should get a lot of the way there. (I totally forgot about this--it's new. It's also not well-tested, so bug reports welcome. :-) ) |
Oh wow despite reading through parsedscene.cpp multiple times that never clicked. |
Hey @mmp , The following works -
However the following does not, which is at odds with your example above -
A complete example:
|
Hello, I renamed this ticket to be about how the Attribute directive works, just so I understand the intended use case. (With the original material overrides on shapes question being way out of scope for pbrt-v4. ) |
Yep, good question. The intended use case is, generally speaking, being able to set default parameters for things (shapes, textures, etc.). e.g.:
This is mostly intended as a convenience for people extending the system (e.g. student projects): "I'd like to indicate that all these shapes have a certain property--how can I do that?" |
Ah cool, thanks for the explanation. Good feature for debugging too! |
A Question:
As far as I can tell, being able to specify Material overrides on Shapes is no longer supported.
If this is correct, how come? Due to GPU implementation? Simplification of code? (I'm not advocating for the return of this functionality I'm simply curious.)
Background:
In pbrt-v3 you could do something along the lines of -
In pbrt-v4 this results in a unused parameter error.
A Follow-up:
Assuming this functionality is no longer supported, then the following code in parsedscene.cpp should probably be changed.
https://github.com/mmp/pbrt-v4/blob/08f863d3/src/pbrt/parsedscene.cpp#L1776
Which renames the "Kd" parameter found on Shapes to "reflectance". This would still result in an error in pbrt-v4, so it should probably be replaced with a
dict.RemoveTexture("Kd")
. Or perhaps more appropriate a straight up error instructing the user to update their scenes.The text was updated successfully, but these errors were encountered: