-
Notifications
You must be signed in to change notification settings - Fork 147
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
Support Compatibility Renderer #217
Comments
I wonder if this would help iOS, where I am seeing the heightmap mesh (including shadows) but with the "chess squares" shader issue (as if it had no textures?). This is with the Godot Project Settings->General->Renderering->Renderer->Rendering Method options: forward_plus or mobile (gl_compatibility shows an all grey plane, no height at all or squares). It looks like iOS is unsupported, but I managed to build for iOS (scons platform=ios), updated the |
If you can render forward_plus or mobile, then that is not related to this issue. What you see on gl_compatibility is this thread. Thanks for letting me know about ios builds. This is the first I've heard about anyone trying it. Please post the full lines that you put in terrain.gdextension. It will help for later when it does maybe become a supported platform. You can make a separate ios support issue if you like so we can keep the discussions focused. The chess squares are textures generated and placed in the texture list. If the forward renderer is displaying them, then there might be another issue as to why the grass/rock textures aren't showing, such as something with export. Let's discuss further on an IOS thread. |
Apparently shadows aren't included in the compatibility renderer yet. Who knows what else isn't finished. This should wait until 4.2 is out with its compatibility shader improvements |
you can see here what is and isn't finished godotengine/godot#66458 |
Here specifically texturearrays are not supported. (even though we read them for height and color) the issue shows it doesn't work for albedo. |
Looks like some big progress towards support got merged last night. There's some wonkiness with the shader but I at least see textures on a web build now. Edit: biggest issue seems to be that usampler2Ds don't seem to work. I wonder if you can work around it with |
That's good news.
The control map uses usamplers for texture placement. You should get no textures if it's not working, or a broken shader if it's an unsupported command.
Yes, you could change the usampler to sampler and wrap the control texelfetches with floatBitsToUint(). But if it's true that usamplers are not supported in opengl, then the better solution is for Godot to support standard opengl formats, including usamplers (which may not have a separate ticket) and that we stay on them until these issues are tracked and implemented. We store the control map as a 32-bit uint directly in memory, then the shader reads a 32-bit uint out of memory. The whole path through the Image/Texture/RenderingServer/RenderingDevice Godot thinks of that portion of memory as a 32-bit float, but we don't care because it doesn't change it. The contents of that memory are a 32-bit uint. If read as a float it's garbage data. Reading it as a usampler is direct. Reading it as a sampler and recasting it with floatBitsToUint can work for an extra step. See all of this ticket, especially my final comment regarding using usamplers and encoding floats. |
Minor update:
|
when we move to 4.3, the texture array issue is now fixed, thanks to this pr a compatability insert that has these defines covers initial shader errors #define fma(a, b, c) (a) * (b) + (c)
#define dFdxCoarse(a) dFdx(a)
#define dFdyCoarse(a) dFdy(a)
#define textureQueryLod(a, b) vec4(0.0) The GPU mouse needs its shader modifying, and its own defines so it can work correctly in compatability. the only thing left is the decal, which can be drawn directly on the terrain (we could move to this for all render modes.) |
Is there any artifact of it? I am still stuck with just my phone, and building from there from what i tried with java is just too time consuming and i am on institute now ( have to do 2 batx again so barely any time). |
there is, linked at the bottom of the PR. (tho its of the original PR for now) |
Compatibility mode has been implemented thanks to @Xtarsia . Try it out in nightly builds. Read about caveats here |
Switch to compatibility mode and the textures are black. Supposedly texture arrays are not supported. However height and the colormap are there, so some texture arrays are being read. So it's unclear what is supported exactly.
Also opengl doesn't support FMA, so a macro should be made to replace fma with
*+
via code or have two separate shaders.Waiting for OpenGL support in Godot:
The text was updated successfully, but these errors were encountered: