-
Notifications
You must be signed in to change notification settings - Fork 43
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
BSShaderProperties update #41
base: develop
Are you sure you want to change the base?
Conversation
Changes made in BSEffectShaderProperty: 1. Changed "Texture Clamp Mode" storage type from uint to byte, due to Skyrim's BSEffectShaderProperty, where the byte value of Texture Clamp Mode is followed by unknown non-zero byte value - it caused a number shown in Texture Clamp Mode line instead of its named value. This unknown byte is mostly set to 255 but in many nifs there are other values. 2. "Emmisive Color" splitted to "Base Color" (named according to CK) and "Alpha". Now the variables 0 and 5 in "EffectShaderControlledVariable" list can be clearly named. Added proposal of abstract object for BSShaderProperties which must not be shared (can't be "combined") for easier excluding of these properties in Nifskope's Combine Properties spell. It is named "NonSharableBSShaderProperty".
So So I think the name doesn't make very much sense. Maybe instead of defining these properties as "nonshareable" in the name, we introduce a new attribute. Something like: <niobject name="BSShaderProperty" abstract="0" inherit="NiProperty" unique="true"> Unfortunately I still don't know what to name the block, as |
So we are inserting an abstract class in the inheritence tree for type checking. Seems okay to me. Would probably go with BsUniqueShaderProperty or somega permutation of it. Not sure I follow your suggestion to use an attribute as not really sure how you know its relation to other blocks. Whereas there is explicit uniqueness through subclassing. |
@neomonkeus The attribute says "properties of this type cannot be combined". Put it on the abstract class, that means that all of the properties that inherit it must be unique. Therefore you do not need to name the abstract parent anything with "Unique" or "Nonshareable" as I already have shown that doing so would be a misnomer. ( The uniqueness is not explicit through subclassing, as programs such as NifSkope would still have to add the check for "inherits Also, imagine that in the future there will be a whole new class of NiBlocks for new games that should not inherit from the existing abstract parent ( The only initial work would be adding a check for the new attribute to the parser. |
Changed Skyrim specific shader blocks (BSLightingShaderProperty, BSEffectShaderProperty, BSSkyShaderProperty, BSWaterShaderProperty) to be inherit from BSShaderProperty.
I take your point about using the inheritance tree should they decide to subclass from a unique and make it non-unique. Suppose my brain is not fully engaged, but what happens in the case of a sub-set of the sub-classes need to be unique. |
@72b711d ... Ah, didn't think to do it that way at all. 👍 |
@jonwd7 @neomonkeus |
Although I understand advantages of having new attribute in nif xml, I don't know if necessary work to adding it would be worthwile. It depends on how often it would be used in applications. We talked about it only due to Combine Spell bug. @jonwd7 - you know nifsope's code - would it be benefical to have this attribute? |
@ttl269 In the short term, not really. In the long term, it'd lower maintenance cost of the codebase. Right now the only check is However I agree that it's probably not worth it unless the XML format is going to undergo large changes anyway (like the ones in my proposals). So I'm fine with shelving such an attribute until then. |
@ttl269 Related, I was looking at if this I'm confused by the wording:
Did Also I'm still figuring out what that code means, but it seems it was never updated for |
Did some poking through the decoding forums - http://niftools.sourceforge.net/forum/viewtopic.php?f=10&t=3193 |
@jonwd7 Did BSShaderProperty not inherit from NiProperty at some point in nif.xml's history? It seems that no. Just before doing change to nif.xml today I have been searching for when |
Increased niftoolsxml version to 0.7.2.0 due to changes in names in this branch.
@@ -1365,6 +1365,12 @@ | |||
</compound> | |||
--> | |||
|
|||
<compound name="TextureClampMode"> | |||
<add name="Mode" type="TexClampMode" default="WRAP_S_WRAP_T">How to handle texture borders.</add> | |||
<add name="Unknown Byte" type="byte" defalut="0">Unknown. In BSEffectShaderProperty of Skyrim nifs it is most often set to 255 but sometimes to other values.</add> |
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.
Typo in "default" on this line and the next.
While doing some testing on the Blender plugin, I spotted some parcularities, which mainly tie back into this proposed change. Had a poke about the SKSE & FOSE code bases and they also use the BSShaderProperty, but with one slight difference in that it inherits from NiShader. I think we should investigate a similiar solution as there are some accompanying things, like how there is an attribute check in a base class (NiNode) for an attribute that is part of the sub-class (BSLightingShaderProperty) which will is should just be done as part of that class. |
@neomonkeus @skyfox69 @jonwd7 @Ghostwalker71 @throttlekitty @nexustheru @amorilia
Changes made in
BSEffectShaderProperty
:Texture Clamp Mode
storage type fromuint
tobyte
, due to Skyrim'sBSEffectShaderProperty
, where the byte value of Texture Clamp Mode is followed by unknown non-zero byte value - it caused showing of a number in Texture Clamp Mode line instead of its showing of named value. This unknown byte is mostly set to 255 but in many meshes there are other values.0
and5
inEffectShaderControlledVariable
list can be clearly named.Added proposal of abstract parent object for Bethesda Shader properties which must not be shared (can't be "combined") for easier excluding of these properties in Nifskope's Combine Properties spell as requested @jonwd7 #72. It is named
NonSharableBSShaderProperty
.