Duke4.net Forums: HQ4x to all tile textures in Polymost rendering - Duke4.net Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

HQ4x to all tile textures in Polymost rendering  "I made a patch to make all low res textures a lot more nicier."

User is offline   Tintin One 

#1

Hello devs,

I made a small patch to make all low res textures to look a lot more better with the well known (LGPL) HQX scaler.

Here is the patch:

--- build/src/polymost.c
+++ build/src/polymost_patched.c
@@ -1157,6 +10325,32 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das
                     }
                 }
             }
+
+    #if 1
+           #include <hqx.h>
+           #define HQX 4
+           #define HQX_fun hq4x_32
+           
+            //if ( !(pth->flags & PTH_HIGHTILE) )
+            {
+                vec2_t siz2 = { HQX * siz.x, HQX * siz.y };
+
+                coltype *pic2 = (coltype*)Xmalloc( siz2.x * siz2.y * sizeof(coltype) );
+
+                static int hq_initiated = 0;
+                if (!hq_initiated)
+                {
+                    hqxInit();
+                    hq_initiated = 1;
+                }
+
+                HQX_fun( (uint32_t*)pic, (uint32_t*)pic2, siz.x, siz.y );
+
+                Bfree( pic );
+
+                pic = pic2;
+
+                siz.x = siz2.x;  siz.y = siz2.y;
+
+                tsiz.x *= HQX;  tsiz.y *= HQX;
+            }
+    #endif
         }

         if (doalloc) bglGenTextures(1,(GLuint *)&pth->glpic); //# of textures (make OpenGL allocate structure)


You can get the HQX library from here. Cheers.
2

User is offline   Hendricks266 

  • Weaponized Autism

  #2

#including a header in the middle of a function? That's a new one.
0

#3

Do you have before and after screenshots?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #4

Yeah. No filtering can make the style of pixel art in Duke "a lot more better".
0

User is offline   Tintin One 

#5

well...

1. Yes, you can add a header (that is, a declaration of functions, variables, macros, etc) from anywhere.

2. I am attaching some before and after screenies.

3. In my opinion all pixel art (2D sprites) look better when upscaled (maybe because I am used to console emulators; heck, even gzdoom shines in his glory with its embedded upscaler!).

Thanks for the feedback :) .

Attached thumbnail(s)

  • Attached Image: A_Before.png
  • Attached Image: A_After.png
  • Attached Image: B_Before.png
  • Attached Image: B_After.png
  • Attached Image: C_Before.png
  • Attached Image: C_After.png

3

User is offline   deuxsonic 

#6

View PostTintin One, on 10 June 2016 - 11:37 AM, said:

well...

1. Yes, you can add a header (that is, a declaration of functions, variables, macros, etc) from anywhere.

2. I am attaching some before and after screenies.

3. In my opinion all pixel art (2D sprites) look better when upscaled (maybe because I am used to console emulators; heck, even gzdoom shines in his glory with its embedded upscaler!).

Thanks for the feedback :) .


Excellent work. This is what I've been asking for for years, a HQ4X filtering option. Please add this to EDuke32.
0

User is offline   Mblackwell 

  • Evil Overlord

#7

Looks like Gaussian Blur + Posterize. Not a fan.
0

User is offline   deuxsonic 

#8

If that's all the code it takes in addition to the library, at least give the option to those who do want texture filtering?
0

User is offline   LeoD 

  • Duke4.net topic/3513

#9

Seems to me it's worth considering to add it as an option.
1

User is offline   Hendricks266 

  • Weaponized Autism

  #10

View PostTintin One, on 10 June 2016 - 10:03 AM, said:

LGPL

I'm not setting up the infrastructure to build and use a .dll/.so/.dylib for this shite. Rejected.
0

#11

View PostHendricks266, on 10 June 2016 - 07:02 PM, said:

I'm not setting up the infrastructure to build and use a .dll/.so/.dylib for this shite. Rejected.

Tintin One you seem to have some fans, maybe Hendricks would consider introducing it to main, if it was more lightweight(e.g. your code plus a header). All the logic for the filter should fit nicely into a single header, without the need for a static or dynamic library.

This post has been edited by icecoldduke: 10 June 2016 - 07:10 PM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #12

The HQx family of filters is licensed under LGPL. We cannot introduce any additional GPL code because it did not come with a linking exception to Build. LGPL code has to live in a dynamic object for the same reason.

If you can get the owner of the filter code to grant a linking exception to Build, then the legal matters are sorted. But I still have no interest in implementing this.
0

#13

View PostHendricks266, on 10 June 2016 - 07:11 PM, said:

The HQx family of filters is licensed under LGPL. We cannot introduce any additional GPL code because it did not come with a linking exception to Build. LGPL code has to live in a dynamic object for the same reason.

If you can get the owner of the filter code to grant a linking exception to Build, then the legal matters are sorted. But I still have no interest in implementing this.

Forgot about that.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #14

Nothing is stopping you guys from running the filter offline and defining it all as hightile. Once I add a def token for Fox's skyboxes to treat hightile data as ART indexes so palswaps and shading work correctly, you might want to use that too.

Or you could set up our toolchain and make patched binaries yourself.
0

#15

View PostHendricks266, on 10 June 2016 - 07:15 PM, said:

Nothing is stopping you guys from running the filter offline and defining it all as hightile.

I'm assuming you mean each user would have to run the filter on the data and have some automated process take care of everything for you? It seems Gearbox might get angry if people start just running a upscale filter on the content and release that as a 8-bit hrp mod.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #16

View Posticecoldduke, on 10 June 2016 - 07:17 PM, said:

I'm assuming you mean each user would have to run the filter on the data and have some automated process take care of everything for you? It seems Gearbox might get angry if people start just running a upscale filter on the content and release that as a 8-bit hrp mod.

Right.
0

User is offline   deuxsonic 

#17

Doing it offline makes for a lot of extra data that isn't necessary when it can easily be done in real-time. What about the xBR algorithm? http://libretro.com/...thread.php?t=88 There are others that produce similar results, with a huge list on here . The HRP is this big ongoing project for Duke which has stuff in it that I find unsightly (some of the stuff in it has actually gone backwards in quality IMHO), but that gets full support while a smarter image scaling algorithm option with very minimal code is "shit" and a definite no when a large number of emulators, including official commercial ones and source ports of other old games like DOOM have this ability. All of those implementations can't be wrong.

This post has been edited by deuxsonic: 11 June 2016 - 01:13 AM

0

User is offline   Tintin One 

#18

View PostHendricks266, on 10 June 2016 - 07:02 PM, said:

I'm not setting up the infrastructure to build and use a .dll/.so/.dylib for this shite. Rejected.


Can I ask why it is so difficult? Aren't you using CMake?

Btw, you seem to hate the sole idea of an upscaller filter, when it is pretty much standard in emulators. Have you played console emulators, right?

And (again) GZdoom has this feature from looooong ago. Why can't eduke32?

:)


EDIT:
...and, you cannot use the filter "offline" to enhance all textures to hi-tile, because this it is nearly impossible to do with the excellent EDuke32 Addon Compilation v2.0! (I mean you will need to repack all the grps, give me a break)

This post has been edited by Tintin One: 11 June 2016 - 06:45 AM

1

User is offline   deuxsonic 

#19

This has been going on forever. There's always some reason why something that a lot of people would actually use can't go into it because he personally wouldn't use it so it's "shit". Disabled by default and the prototype code has already been provided, wouldn't negatively affect anyone because you wouldn't even know about it unless you were looking for it and "nope it's shit." It isn't even the licensing because there are a plethora of other algorithms that accomplish the same thing that he won't consider either. You're telling me that something that GZDOOM and DOOMSDAY and ZSNES and a lot of other large projects using it have to fight licensing issues that would totally not be compatible with EDuke32's licensing or is it that god forbid it have a DLL to tag along. These projects don't support just HQ4x either, but other scaling algorithms, older ones and newer ones, with different licensing schemes.

This post has been edited by deuxsonic: 11 June 2016 - 07:22 AM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #20

View Postdeuxsonic, on 11 June 2016 - 12:03 AM, said:

a large number of emulators, including official commercial ones and source ports of other old games like DOOM have this ability. All of those implementations can't be wrong.

View PostTintin One, on 11 June 2016 - 06:29 AM, said:

Btw, you seem to hate the sole idea of an upscaller filter, when it is pretty much standard in emulators. Have you played console emulators, right?

And (again) GZdoom has this feature from looooong ago. Why can't eduke32?

argumentum ad populum

View PostTintin One, on 11 June 2016 - 06:29 AM, said:

Can I ask why it is so difficult? Aren't you using CMake?

We use straight GNU Make. This wouldn't be difficult--I know exactly how to do it. But I do not want to set up and maintain the infrastructure.

Build your own builds. If you can figure out how to patch in the code, you can figure out how to set up a scheduled task to rebase from upstream and rebuild if there are any changes.
0

User is offline   Mblackwell 

  • Evil Overlord

#21

But it looks like shit.

Seriously.

It makes the textures look like muddy blurry poop with extra colors and rendering artifacts smeared across the front.





As for why they "can't just include it, a patch is already done" ... Go submit your patches to any other large open source project for features they don't want written in ways that don't conform to their standards and with licenses that aren't compatible, and they'll tell you to go home. (Actually, they won't often be that nice.) Having contributed to some big open source stuff I can tell you, you don't just get whatever you want because you or a couple of other people want it.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #22

Seriously. Don't make me break out the image macros of salt shakers and crying babies throwing tantrums.
-2

#23

View PostTintin One, on 11 June 2016 - 06:29 AM, said:

Can I ask why it is so difficult?


View PostHendricks266, on 11 June 2016 - 07:46 AM, said:

Seriously. Don't make me break out the image macros of salt shakers and crying babies throwing tantrums.


Putting Hendricks comment aside, the bigger issue is the library your using is under LGPL which is incompatible with build. So even if Hendricks liked your idea, the library your using is license incompatible with build. You could just learn the algorithm and write the implementation yourself and resubmit and see what Hendrick's says.

As a side not don't get too discouraged, look over at the PolymerNG thread to see some of the trash talking I get thrown my way :).

This post has been edited by icecoldduke: 11 June 2016 - 07:52 AM

1

User is offline   Tintin One 

#24

View Posticecoldduke, on 11 June 2016 - 07:50 AM, said:

the bigger issue is the library your using is under LGPL which is incompatible with build


Can someone please explain me why the build license (which is mostly a modified "advertising" BSD license) is incompatible with the LGPL (which only requirement is to link against the shared dll/so lib)? It is very estrange you can't use shared libraries with build.

:)
1

#25

View PostTintin One, on 11 June 2016 - 08:12 AM, said:

Can someone please explain me why the build license (which is mostly a modified "advertising" BSD license) is incompatible with the LGPL (which only requirement is to link against the shared dll/so lib)? It is very estrange you can't use shared libraries with build.

:)

I've asked this question before too, and it seems to be in the best interest of Voidpoint for it to remain under the current license. This is a perfectly valid reason. So you need to learn how the algorithm works and write it yourself or find a library that yields the same results that is under a less restrictive license.

This post has been edited by icecoldduke: 11 June 2016 - 08:23 AM

0

User is offline   deuxsonic 

#26

Tintin One, I sent you a private message. Please check your inbox.
0

User is offline   Tintin One 

#27

View Posticecoldduke, on 11 June 2016 - 08:16 AM, said:

.. it seems to be in the best interest of Voidpoint for it to remain under the current license.


I see. Well, thanks for the replay. My work here is done. :) Moving to something else.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #28

View PostTintin One, on 11 June 2016 - 08:12 AM, said:

Can someone please explain me why the build license (which is mostly a modified "advertising" BSD license)

1. The GPL is "viral". All source code to a binary must be released under the terms of the GPL.
2. The GPL does not allow any additional requirements on any licensee beyond what it says in its text.

BUILDLIC.TXT states:

Quote

[5] The use of the Build Engine for commercial purposes will require an
appropriate license arrangement with me. Contact information is
on my web site.

The GPL says "you can use this commercially without any further permission from me, as long as you abide by the all of the GPL too". This conflicts, see point #2.

Therefore, for it to be legal to distribute any binary containing both GPL source and BUILDLIC source, the owner of all the GPL source must grant a "linking exemption" against the BUILD engine--in other words, an exception to point #1 above. 3D Realms did this with Duke 3D, Shadow Warrior, AudioLib, and MACT, so using those GPL components is fine.

View PostTintin One, on 11 June 2016 - 08:12 AM, said:

It is very estrange you can't use shared libraries with build.

Read this post again. A shared library is the only way we can use LGPL code.

View PostHendricks266, on 10 June 2016 - 07:11 PM, said:

The HQx family of filters is licensed under LGPL. We cannot introduce any additional GPL code because it did not come with a linking exception to Build. LGPL code has to live in a dynamic object for the same reason.

If you can get the owner of the filter code to grant a linking exception to Build, then the legal matters are sorted. But I still have no interest in implementing this.

0

User is offline   TerminX 

  • el fundador

  #29

View Posticecoldduke, on 11 June 2016 - 08:16 AM, said:

I've asked this question before too, and it seems to be in the best interest of Voidpoint for it to remain under the current license.

Well, even if we wanted to we couldn't exactly just take the Build engine and re-license it.
0

User is offline   LeoD 

  • Duke4.net topic/3513

#30

View PostHendricks266, on 11 June 2016 - 09:00 AM, said:

[...] to be legal to distribute any binary containing both GPL source and BUILDLIC source, the owner of all the GPL source must grant a "linking exemption" against the BUILD engine--in other words, an exception to point #1 above. 3D Realms did this with Duke 3D, Shadow Warrior, AudioLib, and MACT, so using those GPL components is fine.
Tbh., I've never actually come across that linking exemption statement anywhere. Could someone please point me where to find it?
And better add it to the synthesis downloads, otherwise any casual reader of both buildlic.txt and gpl-2.0.txt must consider EDuke32/Mapster32 executable distribution as a GPL violation.
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options