View Issue Details

IDProjectCategoryView StatusLast Update
0005633DarkRadiantMap Editingpublic02.04.2022 05:56
ReporterLDAsh Assigned Togreebo  
PrioritynormalSeveritynormalReproducibilityN/A
Status closedResolutionfixed 
Product Version2.3.0 
Target Version2.14.0Fixed in Version2.14.0 
Summary0005633: Apply textures to surfaces using "normalized" scaling.
DescriptionDarkRadiant used to abide by the "default texture scale" set in preferences, when applying textures to surfaces. Currently, textures seem to apply to surfaces based on the texel scale of the previous texture, such as a 2K texture being applied to a surface that previously had a 32X32 caulk texture using the 32X32 texel scale, instead of the "default texture scale".
Additional Informationhttps://forums.thedarkmod.com/index.php?/topic/20996-poll-normalised-texel-scale-when-applying-new-textures/
TagsNo tags attached.

Activities

greebo

greebo

11.06.2021 10:31

administrator   ~0014080

Can you give me a more elaborate example of how you want it to behave?

I can currently see the following behaviour:
- Drag out a brush, apply textures/common/caulk (128x128 TGA texture)
- Open Surface Inspector, Fit Texture to 1x1
- Click on another texture (using a larger image) in the Texture or Media Browser, it will apply that one to the brush
- The new texture is already fit to the faces, 1x1, like the caulk texture
LDAsh

LDAsh

12.06.2021 01:55

reporter   ~0014081

A new texture selection/application should (in my opinion, and historically default) retain the texel scale of the previously used texture, not the entire texture size. For example, if previously a 256x256 texture is applied to a 64x64 surface, that would be a 4x4 texel scale. Currently, a new texture will retain the size but the not the texel scale, so if a new texure is 1024x1024 and applied to a 64x64 surface, then it would be only partially visible, since the texel scale is still 4x4, instead of 16x16. This seems more intuitive and efficient, even if it's optional and not even the default.
greebo

greebo

12.06.2021 03:49

administrator   ~0014083

I can imagine that there would be some disagreement about what the default behaviour should be - I can see arguments for both behaviours, so I guess this should be controlled by a setting somewhere.
When you say "apply", what operation are you referring to? As there are many ways to set a shader on an object (and some of the MMB operations are specifically designed to adjust the target object to match up with the original projection).
LDAsh

LDAsh

12.06.2021 04:01

reporter   ~0014085

Here's a GIF to demonstrate, with the original behaviour on the left and (since version 2.5.0?) how it was changed, and not even deprecated:-
https://www.violae.net/temp/DR221vDR250_texelscale.gif
The best way to fully understand is to use <2.2.1 side-by-side, or NetRadiant.
greebo

greebo

12.06.2021 04:39

administrator   ~0014087

Last edited: 14.06.2021 14:58

You are interested in what happens when you apply the material through the Texture/Media Browser, I assume?
I'm asking as there are many ways to assign a material to a target, and all of them can work slightly differently.
LDAsh

LDAsh

12.06.2021 05:16

reporter   ~0014090

Perhaps except for when copying and pasting a texture within Radiant, I can't imagine why it wouldn't follow a "texel-scale rule" for everything, and that's why in "Preferences > Primitives > Default Texture Scale" is even an option, I suppose.
IZaRTaX

IZaRTaX

19.06.2021 07:58

reporter   ~0014116

you can change it quickly with the surface inspector,
this is the scale I use for high res textures to match well with them

default scale: 0.250 = 512X512
default scale: 0.125 = 1024X1024
default scale: 0.0625 = 2048x2048

it's a very good idea if it can do it automatically like it will detect the texture scale and automatically calculate the scale for it.
TX_scale.png (1,835,059 bytes)
LDAsh

LDAsh

19.06.2021 15:12

reporter   ~0014117

That may be useful, but, that's still not what I was talking about, and refer back to the GIF I posted:-
https://www.violae.net/temp/DR221vDR250_texelscale.gif

The fact that textures are different resolutions 99.9% of the time means because they are physically bigger, cover larger brushes and take more screen real-estate. That's why the default behaviour should be that all textures are applied based on the "texel scale" of what was applied before it, with the very first (caulk on an "_empty"?) abiding by the "Default Texture Scale" setting in preferences. You can see in that GIF, on the right-hand side example, the long hazard-stripe texture is not only applied much smaller than it ever would be, it's also becomes square instead of rectangular in proportion. This is obviously wrong. I'm not saying to change the default behaviour, but, at least the old proper method could be an option?

There is a difference between texel scale and texture scale. Texel scale is how big a pixel of a texture appears in the 3D world, and this, since the dawn of 3D games, has always had a consistency. Quake 2 was about 1, Quake 3 about 2x2 (0.5), Doom3 about 2x2 to 4x4 (0.25), and HL2 up to 8x8 (0.125). The very first QERadiant I used back in the late 90s did things this way. Now we sometimes get into the 16x16 (0.0625) range for things like door textures, and that's a very fine texellation! But usually there's a baseline consistency and that is still 0.125 for us and probably 0.25 for the TDM mappers.
LDAsh

LDAsh

06.07.2021 09:35

reporter   ~0014149

As I've been testing the latest build, I decided to change the priority and severity of this. Every time I apply a new texture, I need to press CTRL+N each time. Not something worth getting used to, because this is a DR-only thing.
greebo

greebo

06.07.2021 15:53

administrator   ~0014150

While I understand that this is bugging you and it's important for you, setting the priority and the severity of the bugtracker entry will not getting it finished earlier. That's not how it works, the devs are deciding on their own what's important and what they want to work on, it's a hobby after all.

For me, it feels more like trying to rub it into my face, shouting "FIX THIS, NOW!". No hard feelings, just saying. :)
LDAsh

LDAsh

08.07.2021 06:53

reporter   ~0014151

I didn't say anything like that or even want to imply, especially not screaming at you in all caps... !?

Anyway, I decided to make a poll in the forum about this, NOT as some weird passive-aggressive attempt at being underhanded or whatever thingy, but SIMPLY to draw a consensus, for clarification. I swear, that's all it is.
MirceaKitsune

MirceaKitsune

05.08.2021 13:49

reporter   ~0014239

I noticed this issue for ages and would also like to see it fixed when possible. I thought it was a deliberate feature at first, I understand it might in fact be a bug. It's no major breakage but can become an annoyance.

To fully illustrate what's happening here: The X and Y scale of a surface should remain the same if you only edit the texture on that surface. Currently when setting a texture with a different resolution on a brush face, the scale automatically changes based on the difference in resolution between textures.

In screenshot 1 I have the texture textures/darkmod/stone/brick/blocks_brown set on the selected face, at a scale of 0.25 x 0.25. In screenshot 2 I change this texture to textures/darkmod/stone/brick/blocks_sandstone01. I did not edit the scale though: The vertical scale became 0.5 on its own.
Screenshot_20210805_163850.png (176,244 bytes)   
Screenshot_20210805_163850.png (176,244 bytes)   
Screenshot_20210805_164032.png (167,912 bytes)   
Screenshot_20210805_164032.png (167,912 bytes)   
greebo

greebo

08.10.2021 18:17

administrator   ~0014418

@LDAsh If you have a chance I'd ask you to check out the snapshot build at https://github.com/codereader/DarkRadiant/actions/runs/1320874193 (you have to be logged in). I adjusted the Face material assignment routine to preserve the texel scale of the previously assigned material.
LDAsh

LDAsh

09.10.2021 12:06

reporter   ~0014420

I had a look and I'm personally extremely happy with the behaviour now! :D
I couldn't find an option for this, so some others might complain about it now (can't make everybody happy) but this feels like the good old days again.
Thanks a million, Mr.Greebo. Great work, as always.
greebo

greebo

09.10.2021 16:05

administrator   ~0014421

Nice, thanks

Related Changesets

DarkRadiant: master ced8ed41

2021-10-08 14:02:41

greebo

Details Diff
0005633: Add IFace::getTexelScale() to read the calculated texture pixel density of faces. Add corresponding unit test. Affected Issues
0005633
mod - include/ibrush.h Diff File
mod - radiantcore/brush/Face.cpp Diff File
mod - radiantcore/brush/Face.h Diff File
mod - test/TextureManipulation.cpp Diff File
mod - test/algorithm/Primitives.h Diff File

DarkRadiant: master 3f2e0386

2021-10-08 14:24:50

greebo

Details Diff
0005633: Set up unit test checking texture scale preservation when swapping textures on a face Affected Issues
0005633
mod - test/TextureManipulation.cpp Diff File

DarkRadiant: master f156a5b7

2021-10-08 15:12:53

greebo

Details Diff
0005633: Add scale adjustment to Face::setShader(), to preserve the scale of the previous material Affected Issues
0005633
mod - radiantcore/brush/Face.cpp Diff File

Issue History

Date Modified Username Field Change
03.06.2021 05:28 LDAsh New Issue
03.06.2021 05:51 greebo Status new => acknowledged
11.06.2021 10:31 greebo Status acknowledged => feedback
11.06.2021 10:31 greebo Note Added: 0014080
12.06.2021 01:55 LDAsh Note Added: 0014081
12.06.2021 01:55 LDAsh Status feedback => new
12.06.2021 03:49 greebo Note Added: 0014083
12.06.2021 03:49 greebo Status new => feedback
12.06.2021 04:01 LDAsh Note Added: 0014085
12.06.2021 04:01 LDAsh Status feedback => new
12.06.2021 04:39 greebo Note Added: 0014087
12.06.2021 05:16 LDAsh Note Added: 0014090
14.06.2021 14:58 greebo Note Edited: 0014087
19.06.2021 07:58 IZaRTaX Note Added: 0014116
19.06.2021 07:58 IZaRTaX File Added: TX_scale.png
19.06.2021 15:12 LDAsh Note Added: 0014117
06.07.2021 09:33 LDAsh Priority low => high
06.07.2021 09:33 LDAsh Severity tweak => major
06.07.2021 09:35 LDAsh Note Added: 0014149
06.07.2021 15:53 greebo Note Added: 0014150
06.07.2021 15:53 greebo Priority high => normal
06.07.2021 15:53 greebo Severity major => normal
08.07.2021 06:53 LDAsh Note Added: 0014151
26.07.2021 18:30 greebo Additional Information Updated
05.08.2021 13:49 MirceaKitsune Note Added: 0014239
05.08.2021 13:49 MirceaKitsune File Added: Screenshot_20210805_163850.png
05.08.2021 13:49 MirceaKitsune File Added: Screenshot_20210805_164032.png
08.10.2021 12:34 greebo Product Version => 2.3.0
08.10.2021 12:34 greebo Assigned To => greebo
08.10.2021 12:34 greebo Status new => assigned
08.10.2021 15:15 greebo Changeset attached => DarkRadiant master ced8ed41
08.10.2021 15:15 greebo Changeset attached => DarkRadiant master 3f2e0386
08.10.2021 15:15 greebo Changeset attached => DarkRadiant master f156a5b7
08.10.2021 15:15 greebo Target Version => 2.14.0
08.10.2021 15:15 greebo Status assigned => resolved
08.10.2021 15:15 greebo Resolution open => fixed
08.10.2021 15:15 greebo Fixed in Version => 2.14.0
08.10.2021 18:17 greebo Note Added: 0014418
09.10.2021 12:06 LDAsh Note Added: 0014420
09.10.2021 16:05 greebo Note Added: 0014421
02.04.2022 05:56 greebo Status resolved => closed