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

BSEffectShaderProperty - Texture Names #44

Open
hexabits opened this issue Jan 31, 2015 · 2 comments
Open

BSEffectShaderProperty - Texture Names #44

hexabits opened this issue Jan 31, 2015 · 2 comments

Comments

@hexabits
Copy link
Member

(Edit: Forgot this part was included in #41)
It seems that nearly all values for this are 65283 (0xFF03). I'd like to find examples that are not though.

I'm not sure if the FF part is really part of the texture clamp mode, since the 03 part matches up with TexClampMode type in nif.xml. WRAP_S_WRAP_T (3) is the most common value.

However the storage type of TexClampMode is uint so it is meant to take up that many bytes and therefore it can't be used with BSESP.

There is a small chance the extra data has to do with the second texture. I have just figured out that the "Greyscale Texture" is actually set to mirrored repeat. It has to be with the way the texture is used as a LUT, or when the sampler gets values near 0.0 or 1.0 there are artifacts.


Speaking of, I feel the names for the textures are wrong. "Greyscale Texture" is actually what the "Source Texture" should be called. The color in the "Source Texture" doesn't actually matter as only the green channel is taken into account. I've tested and confirmed this. So, generally, the "Source Texture" is meant to be greyscale.

The "Greyscale Texture" is best called a Palette Texture, or Lookup Texture. The reason is because it is used as a LUT (look up table) given the "Source" texture as input. This is only if using SLSF1_Greyscale_To_PaletteColor/SLSF1_Greyscale_To_PaletteAlpha. Note the name... Greyscale to Palette.

@hexabits
Copy link
Member Author

hexabits commented Feb 1, 2015

@ttl269 Sorry, I didn't notice #41 included the first part of this ticket. The second part still applies.

@hexabits hexabits changed the title BSEffectShaderProperty - Textures, Clamp Mode BSEffectShaderProperty - Texture Names Feb 1, 2015
@hexabits
Copy link
Member Author

hexabits commented Feb 1, 2015

Also, you can see what the Effect Shader does mathematically speaking here: https://github.com/jonwd7/nifskope/blob/ac00f5c4c7c16a2ebb262325fc8504eb47a192cd/res/shaders/sk_effectshader.frag

I agree with your name changes, especially considering how they line up with the shader math.

Note that when "Greyscale to Color" is used, only the Red value of the Base Color Multiple is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant