Facepunch / sbox-issues

176 stars 12 forks source link

Let me disable texture filtering more easily than currently #4331

Open e1m1e opened 9 months ago

e1m1e commented 9 months ago

For?

S&Box

What can't you do?

I'm unable to disable texture filtering in the material editor and particle editor, at any level. I have to go through shadergraph to do this for materials, but I'm still stuck when it comes to rendering sprites the particle editor.

How would you like it to work?

If I want to make a Quake-like with Quake-like graphics and I want to turn off texture filtering it would be good to have any of the following:

What have you tried?

I can turn off texture filtering for a custom shader, but not for particles or vtex.

To consider: what if players want to turn texture filtering on? How would you handle that globally?

Additional context

No response

handsomematt commented 9 months ago

How do other engines expose texture filtering? We're doing it on some of our shaders with a combo I think which is nuts. Sometimes the shader 100% knows what is best and doesn't want the user changing it, so I'm curious how other engines approach it.

A fully customisable complex shader (so I can remove unwanted stuff like normals, roughness/metalness, etc, and add texture filtering options)

There's so many fucking combos on this shader already, we're not adding more. That stuff absolutely sounds like a simple shader you should easily be able to do in graph.

e1m1e commented 9 months ago

How do other engines expose texture filtering? We're doing it on some of our shaders with a combo I think which is nuts. Sometimes the shader 100% knows what is best and doesn't want the user changing it, so I'm curious how other engines approach it.

A fully customisable complex shader (so I can remove unwanted stuff like normals, roughness/metalness, etc, and add texture filtering options)

There's so many fucking combos on this shader already, we're not adding more. That stuff absolutely sounds like a simple shader you should easily be able to do in graph.

The customisable shader concept seems like a natural progression at this point with the flexibility of the scene system. If I want to create a specific type of shader instead of using a shader graph, like how particle systems are now simplified for the scene system, it feels like a normal step would be something similar, where you can mix and match the most wanted parts of a shader. I agree that this isn't a good solution though and it sounds like shit.

But it still doesn't answer the question that you posed about how you handle it engine-wide. If you don't handle it engine-wide, it means you'd have to add the ability to mess around with filtering at multiple levels - vtex, shader, material, particles, etc.

Perhaps managing at the project/scene level would be useful. You can describe the graphical settings you'd want for the project you're working in, or create a graphical profile for each scene or project. I could describe mips, LODs, filtering, antialiasing, render resolution, stuff like that.

Right now I can use a retro shader for mats, maybe add a few things onto the shader like animation or whatever. But particles and vtex still don't have the ability to do these things.

e1m1e commented 9 months ago

To add, the ability to determine colour depth & even custom colour palettes would be absolutely amazing.

dch-GH commented 9 months ago

How do other engines expose texture filtering?

In Unity and Godot, filtering can be set per texture via import settings of the texture assets. I'm don't know how they handle that in their default shaders, which is probably the actual point of your question. It can be pretty jarring coming from other engines where it's just a simple tickbox on the texture asset, going from that, to having to write an entirely custom shader. I appreciate that it is now much simpler with things like shadergraph though.

garrynewman commented 9 months ago

I think textures should have a filter mode, set on the texture. The shaders would use that filter mode if they don't want to force a specific mode.. maybe?

handsomematt commented 9 months ago
Screenshot 2023-12-30 at 10 49 11

Probably makes most sense here, I can see a way to do it this way without stupid combos or worrying about shit in shaders.

e1m1e commented 9 months ago
Screenshot 2023-12-30 at 10 49 11

Probably makes most sense here, I can see a way to do it this way without stupid combos or worrying about shit in shaders.

Thanks for taking a look at this. How would vtex filtering work? Add a similar option in the editor?