-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
Add Affine texture mapping to BaseMaterial3D #114021
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
base: master
Are you sure you want to change the base?
Conversation
|
Similar to reasoning to avoiding palettes colors in images, I would think that adding a mode that makes quality worse for a PBR engine would be weird. |
|
that's a fair point, however i could say the same thing about per-vertex or lambert lighting. unless i am mistaken and there are real uses for these, they would both result in worse quality than standard pbr. |
In my experience per-vertex shading and lambert diffuse are commonly used "good enough" modes that are cheaper to compute, especially for particles/alpha materials that fill the screen |
Adding vertex lighting is also considered a rendering degradation, but this did not prevent it from becoming part of Godot. |
|
I think vertex lighting was resisted for several godot 4 versions and was not in 4.0 |
Co-authored-by: A Thousand Ships <[email protected]>
…ure mapping Co-authored-by: A Thousand Ships <[email protected]>
|
See the discussion here: #78104 My preference would be to add the noperspective mode to varyings in the Godot Shader Language so users can use it in custom shaders. My sense is that most people doing PSX shaders go for the full aesthetic (crunchy textures, vertex snapping, affine texture mapping, dithering, etc.). So just adding affine texture mapping won't be enough. If we add noperspective, then anyone can easily use it and the code in BaseMaterial would become extremely simple |
I do agree that this would be a good change and one I'm willing to make, however would it even be possible to modify the shader compiler to do such a thing on low end hardware? I'm not familiar with how the shader compiler works so I can't say. I will try to get something working, and come back when I do. |
|
After a few hours of work, I was able to hack in support for Guidance would be appreciated, for now I'll keep the changes local and await further instructions. |
Adds affine texture mapping to BaseMaterial3D.
This effect is useful for retro graphics, such as recreating the visual style of the original Playstation. I personally made this to prevent having to do several different StandardMaterial3D -> ShaderMaterial conversions due to code repetition.
This is an effect with very little use case outside of PSX style games, but I see many PSX games being made in Godot so I believe it may benefit by having this option be something out of the box.
This effect works by reversing the perspective correction that the GPU does. This is usually done via a
noperspectivekeyword in the shader language, but I could not find documentation saying that there was such keyword in glslang.