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

--convert-3to4 doesn't convert shaders #63673

Open
Tracked by #73960
TokisanGames opened this issue Jul 30, 2022 · 5 comments
Open
Tracked by #73960

--convert-3to4 doesn't convert shaders #63673

TokisanGames opened this issue Jul 30, 2022 · 5 comments

Comments

@TokisanGames
Copy link
Contributor

TokisanGames commented Jul 30, 2022

Godot version

5c6744a

System information

Win 10/64 NVIDIA GeForce GTX 1060/PCIe/SSE2

Issue description

According to my incomplete conversion log found in issue #63672, all my shaders in assets/shaders were converted. However the work is far from complete.

  • There are new .gdshader files, but all the old .shader files are still there and weren't deleted or renamed.

  • The new shaders have render_mode async_visible, which GD4 doesn't support and gives an error.

  • In fact, the shaders were hardly touched at all. The only difference I see is NORMAL_MAP. There are so many more issues.

These are all of the necessary conversions I have identified for my shaders. I'm not sure about backlight. It appears to be a functional replacement, but it is a poor quality replacement. I haven't decided if it needs an issue filed yet.

			$line =~ s/async_visible,?//g;
			$line =~ s/depth_draw_alpha_prepass/depth_draw_opaque/g;
			$line =~ s/hint_color|hint_albedo/source_color/g;
			$line =~ s/hint_white/hint_default_white/g;
			$line =~ s/hint_black_albedo|hint_black/hint_default_black/g;
			$line =~ s/hint_aniso/hint_anisotropy/g;
			$line =~ s/NORMALMAP/NORMAL_MAP/g;
			$line =~ s/INV_CAMERA_MATRIX/VIEW_MATRIX/g;
			$line =~ s/CAMERA_MATRIX/INV_VIEW_MATRIX/g;
			$line =~ s/WORLD_MATRIX/MODEL_MATRIX/g;
			$line =~ s/TRANSMISSION/BACKLIGHT/g;
			$line =~ s/ALPHA_SCISSOR/ALPHA_SCISSOR_THRESHOLD/g;

@qarmin

@TokisanGames TokisanGames changed the title --convert-3to4 doesn't really convert shaders --convert-3to4 doesn't convert shaders Jul 30, 2022
@akien-mga akien-mga added this to the 4.0 milestone Jul 30, 2022
@qarmin
Copy link
Contributor

qarmin commented Aug 3, 2022

Problem with getting automatically list of all available shader values is reason why so much things are not renamed in shaders.
Feel free to open PR with shader renames so other contributors could look at this renames(I don't use shaders in code, so I can't really check if this renames are valid)

Place where such renames could be added

static const char *shaders_renames[][2] = {
{ "ALPHA_SCISSOR", "ALPHA_SCISSOR_THRESHOLD" },
{ "NORMALMAP", "NORMAL_MAP" },
{ "NORMALMAP_DEPTH", "NORMAL_MAP_DEPTH" },
{ "TRANSMISSION", "SSS_TRANSMITTANCE_COLOR" },
{ nullptr, nullptr },
};

Problem with not removing shader fle should be fixed when merging latest PR with bugfix

@XaurDesu
Copy link

XaurDesu commented Jul 8, 2023

would it be possible to replicate this bug on a different Nvidia SKU? for reference, i currently have a 1650 mobile and a gtx 960. Is there any way i can replicate this problem?

@TokisanGames
Copy link
Contributor Author

Has nothing to do with the hardware, so yes. And it's not a bug, it just wasn't implemented at the time of creation.

If you have your own project, use the search and replace lines to manually convert it.

If you're making an engine PR, follow the direction in the 1st and 2nd posts to rename files and edit scripts based on the identified patterns.

@XaurDesu
Copy link

Alright, i'll take a look into this.

@guilhermevfa
Copy link
Contributor

guilhermevfa commented Oct 21, 2023

Hi! I was searching discrepancies between the Godot 3.5 and Godot 4.1 shader docs in hopes of contributing to fix this issue. Basically I found one wrong existing coversion (depth_draw_alpha_prepass).
There are other discrepancies of things that Godot 4 doesn't support (like render_mode async_visible or LIGHT_VEC), but I'm not sure what could be done about that.
I'm trying to find other places to compare documentation and figure out what might be missing. Any suggestions for such resources would be really helpful. If you don't have any, I'll probably just submit my pull request for review.

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

8 participants