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

8 uvs for glTF2, URI decode and Vertex Custom api #52504

Merged
merged 1 commit into from
Sep 11, 2021

Conversation

fire
Copy link
Member

@fire fire commented Sep 8, 2021

@fire
Copy link
Member Author

fire commented Sep 8, 2021

Current status:

  • Exporting a godot scene to gltf2 seems to export texcoord0 to texcoord7
  • Import gltf2 with texcoord0 to texcoord7 doesn't seem to work
  • customs are 4 floats and not colors.
  • Write a test case project in Godot Engine

@lyuma
Copy link
Contributor

lyuma commented Sep 9, 2021

Updated the review with support for float based custom formats in SurfaceTool, EditorSceneImporterMesh and GLTFDocument.

Future work: support importing uvs to half-based or unorm-based CUSTOM* channels; support half and unorm/snorm types in SurfaceTool::create_vertex_array_from_triangle_arrays and support exporting half and unorm/snorm types to TEXCOORD_ channels in gltf.

Here's a shader program I use to test UVs. It shows 3 of the 4 channels based on screen quadrant:
UV/UV2 in left 25%, CUSTOM0 in 25%-50%, CUSTOM1 in 50%-75% and CUSTOM2 in 75%-100%

test_8_uvs.gdshader
image showing different uv channels in left split of the screen

It does seem like CUSTOM0, CUSTOM1 and CUSTOM2 show the same data in the shader. I tried reordering the bufferviews such that it should have guaranteed the custom channels are different, but I haven't entirely ruled out yet if the input data is bad.
Anyway this is a good start. We'll need to do more extensive testing.

@fire fire force-pushed the gltf_8_uv branch 3 times, most recently from a01a601 to 0c73f9a Compare September 9, 2021 05:54
@fire
Copy link
Member Author

fire commented Sep 9, 2021

Demo Project and video.

2021-09-08_23-05-35.mp4

multi_uv_set_test.zip

@fire fire force-pushed the gltf_8_uv branch 4 times, most recently from dd2cbd4 to 3254a13 Compare September 9, 2021 06:42
@fire fire marked this pull request as ready for review September 9, 2021 07:08
@fire fire requested review from a team as code owners September 9, 2021 07:08
@fire fire changed the title Gltf 8 uv glTF2 8 uv Sep 9, 2021
@fire fire changed the title glTF2 8 uv 8 uvs for glTF2, URI decode and Vertex Custom api. Sep 9, 2021
@fire fire changed the title 8 uvs for glTF2, URI decode and Vertex Custom api. 8 uvs for glTF2, URI decode and Vertex Custom api Sep 9, 2021
@fire fire force-pushed the gltf_8_uv branch 3 times, most recently from d118a59 to 603e52c Compare September 9, 2021 08:40
@mhilbrunner mhilbrunner added this to the 4.0 milestone Sep 9, 2021
@reduz
Copy link
Member

reduz commented Sep 9, 2021

Looks good to me, will merge later today or tomorrow if no one else objects.

Add glTF2 uri decode for paths.

Add vertex custom apis.

Add scene importer api.

Change Color to float; add support for float-based custom channels in SurfaceTool and EditorSceneImporterMesh

Co-authored-by: darth negative hunter
 <thenegativehunter2@users.noreply.github.com>
@reduz reduz merged commit 8aedcfc into godotengine:master Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New UV Channel imports into a scene file Support multi uv channels in gltf2.
4 participants