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

[Request] Field Models editor: Preview directional lighting in editor #119

Open
HeyItsLollie opened this issue Jul 20, 2021 · 2 comments
Open
Labels

Comments

@HeyItsLollie
Copy link

HeyItsLollie commented Jul 20, 2021

Is it possible to add the results of "Global light" and "Directional light" to the preview window in the Field Models editor?

MakouReactor-FieldEditorMockup

@jeromearz
Copy link

Wow if you have results to share, please do! What we need is to add normals from the P file and then colored light sources. If someone wants to work on this, please starts from the develop branch

@HeyItsLollie
Copy link
Author

HeyItsLollie commented Jul 23, 2021

Sorry, I should have mentioned, the images are just mock-ups! I was using screenshots from FF7-PC, but the lighting you see is the result of these lighting values.

For anyone willing to give it a try, as far as I can gather:
You can get lighting direction by testing the position of the point at X,Y,Z against 0,0,0, and then apply the result locally to each mesh in the model, using the normals of each vertex. I've been told this is actually a classic lighting technique for 3D, so it should thankfully be well documented. It likely uses a vector dot product, eg: dot(vertexNormal, lightDirection)

Light intensity might be vertex length, measuring the distance between X,Y,Z and 0,0,0 (where the maximum length is 32768).

The lighting itself is effectively just vertex colors.
"Global Light" tints the entire model uniformly, where White is full-bright, and Black is full-dark.
"Directional Light" channels are blended additively per-mesh.
CidLighting

@myst6re myst6re added the feature label Sep 4, 2022
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

3 participants