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

Lighting problems: negative lighting’s scuff and vertex shading’s yet to be implemented. #6404

Closed
DarkDruid216 opened this issue Mar 2, 2023 · 13 comments

Comments

@DarkDruid216
Copy link

Describe the project you are working on

I’m working on a mobile turn based tactics game with its graphics in the vein of 5th gen games. I’m looking to use baked lighting for my scenes so the device wouldn’t have to process them on every single frame.
This’s only half of the story. I’m looking to use vertex lighting to cheapen the cost to run the game. I’m also thinking of using subtractive lighting for the likes of exitways, interiors, or certain abilities to have them pop a tad bit more.

Describe the problem or limitation you are having in your project

I see they’ve yet to implement vertex shading.
Meanwhile, negative lighting seems half implemented. It half works as expected, subtracting the lighting from the scene, but it seems to add in other distances.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

🤷‍♂️
Just finish implementing them?

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

If this enhancement will not be used often, can it be worked around with a few lines of script?

Not necessarily.

Is there a reason why this should be core and not an add-on in the asset library?

Well… they are the core features.

@AThousandShips
Copy link
Member

AThousandShips commented Mar 2, 2023

"just finish implementing them" is rude and unhelpful

Are you talking about per vertex lighting in baked lightmaps?

@DarkDruid216
Copy link
Author

Real-time lighting.
I was mostly concerned about real time lighting.
I was planning to use mainly pixel-based lighting for my baked lightmaps.
Though, vertex based baked lighting for ambient occlusion would be pretty cool.

my apologies for it sounding rude by the way.

@AThousandShips
Copy link
Member

AThousandShips commented Mar 2, 2023

You can already do vertex based lighting? Or what specifically are you looking for?

@DarkDruid216
Copy link
Author

Well… I can’t. That’s the entire problem.
I made an entire shader and toggled it to activate “vertex shading.” It doesn’t work because, according to the tooltip, it’s yet to be implemented.

@AThousandShips
Copy link
Member

AThousandShips commented Mar 2, 2023

My bad I had forgotten it wasn't available at the moment, but I'm still not sure what this proposal is about?

@DarkDruid216
Copy link
Author

Aye. Apologies on my end, as well. 😵‍💫
Either way, no worries. You’re good.
We’ve reached an understanding here.

@AThousandShips
Copy link
Member

AThousandShips commented Mar 2, 2023

I don't know what the timeline for implementing vertex lighting for Vulkan, but probably in 4.1

You're good too

@DarkDruid216
Copy link
Author

Ah. Sounds like something to keep my eye on, then. Compatibility, by the way. People who don’t have Vulkan are part of my audience! ÙwÓ

@AThousandShips
Copy link
Member

The timeline for compatibility is likely a bit slower because it's generally behind the curve compared to Vulkan in terms of completeness

@Calinou
Copy link
Member

Calinou commented Mar 2, 2023

Regarding the negative lighting issue, are you sure specular lighting isn't messing with the final result? Try setting Specular to 0 when using negative lights. (Note that the Specular property has no effect with DirectionalLight3D in 4.0, but it works with omni and spot lights.)

Though, vertex based baked lighting for ambient occlusion would be pretty cool.

This is already feasible by painting vertex colors in your 3D modeling software, then ensuring the model is exported with vertex colors (and Vertex Color > Use As Albedo is enabled on materials). You can keep relying on per-pixel shading for real-time lighting this way, which is sometimes desired. Using unshaded mode and vertex colors will give you the best performance, but it won't allow real-time lights to light up objects using this unshaded mode + vertex colors.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2023
@DarkDruid216
Copy link
Author

DarkDruid216 commented Mar 2, 2023

A02131F1-CE3C-4550-A4B2-FC8092217055

well, I tried that, but here’s the results.
If it’s one, it works as expected, but if it’s higher than 1…

@Calinou
Copy link
Member

Calinou commented Mar 2, 2023

well, I tried that, but here’s the results.
If it’s one, it works as expected, but if it’s higher than 1…

You'll probably need to use a material with a custom shader to clamp lighting values in the light() function. See also #484.

@DarkDruid216
Copy link
Author

Think I’ve to do so, as well.

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

No branches or pull requests

3 participants