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

What is m_shininess range? OBJ goes over GL_SHININESS (0-128) and MM3D sliders range is (0-1) #157

Open
m-7761 opened this issue Apr 9, 2021 · 3 comments
Labels

Comments

@m-7761
Copy link

m-7761 commented Apr 9, 2021

I'm hitting a glGetError on GL_SHININESS because OBJ file range for this is 0-1000 whereas OpenGL's is 0-128. This is just an exponent, i.e. pow(x,y) so it makes sense to clamp the OBJ loader. But I wonder if MM3D should go over 1 too? Or is that just not a realistic setting?

EDITED: I should note, I didn't even set up shininess for the OBJ file exported from Blender, so it's apparently defaulting to something like 225 I think it was? Is that an astronomical setting? If not MM3D is probably low-balling by limiting to 1.0 maximum. To my mind MM3D is not letting it be a power function as opposed to square-root style fractional exponent.

EDITED: Never mind (I guess?) the materials property window scales the value to 0-1 from 0-100.

@zturtleman
Copy link
Member

I don't know anything about shininess to be honest.

@m-7761
Copy link
Author

m-7761 commented Apr 11, 2021

Fortunately it's very simple. In the specular computation there's a pow function, so shininess is just pow(x,shininess). Edited: It's also called the "specular exponent" and the error that can arise (repeating OP) is OpenGL hits an error if the exponent is higher than 128 for some reason. Clamping it is all that's required. (MM3D's valid range seems to be 0 to 100. 28 less than OpenGL's.)

@m-7761
Copy link
Author

m-7761 commented Apr 11, 2021

Actually that reminds me. If there are valid reasons to use an exponent less than 1, I think the Qt setup I saw yesterday may be limited to 100 ticks. Probably a value can be inputted by hand to under 1, but the ticks would only allow 0 or 1 and not anything between. Anyway the code I looked at divided the slider value by 100.

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

No branches or pull requests

2 participants