gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
770 stars 177 forks source link

Duplicated texture coordinates #2607

Closed ghost closed 2 years ago

ghost commented 2 years ago

Removes duplicated texture coordinate bounds and offsets.

DO NOT MERGE. Doesn't work with fast shaders. ShaderFragmentCorrectTexCoords() has to be split in two for it to work.

Besides, it should be possible to rasterize only one texture coordinates. vTexCoord0 and vTexCoord1 contain the same texture coordinates. They only differ after the texture engine applies tile specific shift, offset, clamp, mirror and wrap. Again, this only applies to accurate texture coordinates, so it may be tangled to implement atm.

Is the plan to keep the fast texture coordinates path forever or just until Public Release 5 is accomplished? It is a pain in the arse to write everything twice and in two different ways.

fzurita commented 2 years ago

I hope we keep the fast path for as long as there are mobile devices. I do believe the @gonetz plans to remove GLES 2.0 support after the next public release, but that doesn't include the fast path. There is GLES 2.0 code in both the fast and accurate paths.

Also, the fast path improves compatibility with existing texture packs.

gonetz commented 2 years ago

Is the plan to keep the fast texture coordinates path forever or just until Public Release 5 is accomplished? It is a pain in the arse to write everything twice and in two different ways.

I hope we keep the fast path for as long as there are mobile devices.

Yes, I think that we should keep "fast path" code, but I don't plan to add new fixes to it. There are common parts between "fast" and "accurate". As soon as some of that part should be modified, current part goes to "fast" and modified to "accurate".

gonetz commented 2 years ago

As soon as some of that part should be modified, current part goes to "fast" and modified to "accurate".

Done in duplicated_texture_coordinates branch, commit 3b881ecc89

gonetz commented 2 years ago

Besides, it should be possible to rasterize only one texture coordinates. vTexCoord0 and vTexCoord1 contain the same texture coordinates. They only differ after the texture engine applies tile specific shift, offset, clamp, mirror and wrap. Again, this only applies to accurate texture coordinates, so it may be tangled to implement atm.

Done in 83840372d970

ghost commented 2 years ago

Done in 8384037

Looks good to me. Feel free to close this if you merge that one.

gonetz commented 2 years ago

Close this PR since it is merged as 4e0a4f700c.