Another DPI question... But regarding textures for 3d

Started by TheBadger, January 08, 2016, 01:45:32 PM

Previous topic - Next topic

WAS

#15
Also, DPI is taken into account for game engines when resampling. Resampling is a mathematical equation that determines how to combine the DPI (PPI) at different scales on screen. A Low DPI image cannot be up-scaled well, thus in a game if you walked up to it, it would get grainy. This would easily explain use for LOD with 72 as apposed to anything viewed close.



Resampled pics with low to high DPI.

Again, Bethesda, does not just grab textures from Google. Like most game companies they have texture artists who use stock photos.... While you could find the stock photo used, they're usually from expensive packs.

Pixels of a image are not present until it is rendered. For example, I cannot open a Image with GD and just read the pixels, I must first render it and determine the pixels rendered by the file settings. This also allows for quality at higher resolution when resampling (re-rendering at higher resolution)

TheBadger

That is resolution? IF you create your own images like that and just change dpi you will not get the results you see in that image?

It has been eaten.

WAS

#17
Quote from: TheBadger on January 08, 2016, 03:58:30 PM
That is resolution? IF you create your own images like that and just change dpi you will not get the results you see in that image?

You would need a factored image from 600 DPI and scale down, correct. It's exactly why you see pixelated images in a game like Minecraft when you walk up to a wall painting. The skin image is either 16x16 - 256x256, but your resolution (and the game resolution) is at whatever your monitor is. There is not enough DPI data available for it to upscale any further without quality loss.

So lets say minecraft worked with a 4k image for painting. On a 1920x1080 monitor it will always look crisp as you cannot get the engine to resample it any higher. If it was a 1080p image, same story. If it was a 720p image at 600dpi, it could look good while resampling, but if you were on a 4K resolution, you would then get a effect similar to the 72 DPI image above.

WAS

10 x 10 image resampled to 300 x 300 in UE4

First is 72, second is 300, that's the effect it gave me





TheBadger

I don't know what a factored image is.

LOL,

This is funny. I started out knowing exactly what I should do, then got turned around on something, post a question, got clear, got confused, got clear, and now am somewhat confused again.

It has been eaten.

WAS

#20
Quote from: TheBadger on January 08, 2016, 04:15:28 PM
I don't know what a factored image is.

LOL,

This is funny. I started out knowing exactly what I should do, then got turned around on something, post a question, got clear, got confused, got clear, and now am somewhat confused again.

a project starting at whatever DPI resolution and scratch material.

Basically, in this modern world now. Use 300-600 DPI. It can then be converted for whatever purposes by whatever browser/engine/thing.

Oshyan

I'm 99% sure that DPI does not matter whatsoever in games or most any other purposes *except* print and *sometimes* web. Resampling in games is based on absolute texture (image) resolution in pixels and on in-game display scaling, which is generally independent of both screen resolution *and* PPI/DPI.

- Oshyan

Upon Infinity

Quote from: TheBadger on January 08, 2016, 04:15:28 PM
I don't know what a factored image is.

LOL,

This is funny. I started out knowing exactly what I should do, then got turned around on something, post a question, got clear, got confused, got clear, and now am somewhat confused again.

I stand by my original statement; dpi is absolutely, completely meaningless to the creation of 3d objects.  To the degree that it prompts you for a number, just put in 100 and forget it even asked.  The ONLY thing that matters is total pixels and how close the object will ultimately be to the camera.  No matter your total pixels, there will be a point where those textures will fail for a raster image as the camera approaches. But you have to factor in the dividing of your texture by how many sides are used.  Unless you set a new uv set and texture for each side, of course.

WAS

#23
Quote from: Oshyan on January 08, 2016, 05:23:39 PM
I'm 99% sure that DPI does not matter whatsoever in games or most any other purposes *except* print and *sometimes* web. Resampling in games is based on absolute texture (image) resolution in pixels and on in-game display scaling, which is generally independent of both screen resolution *and* PPI/DPI.

- Oshyan

Unreal Engine 4 upscaling a 10x10 image says otherwise, there is a noticeable difference in quality and subsequently saved, file size. 

A large image, with a large DPI can be resampled with higher quality. A low DPI cannot. Simple as that. A low DPI image blown up twice the size will look terrible compared to the latter.

A game engine is continuously resampling, which uses this algorithm to determine pixel blending...

Granted, some engines have no texture filtering (skew and transform the texture rather then resample), but modern engines usually do, and with DX12, even more features.

I'm not sure what's all in the file, or why it's bigger with larger DPI, but it's being used in resampling as seen visually.

Also, raw buffered images form a games engine being put to print for promotional uses would look terrible if everything is render with low DPI, would it not? You can clearly see this with in-game art on boxes from old games to new (Just within the last 10 years).

Prior to 4k textures even heads of gaming and CG state "If 4096x4096 @ 300 dpi were available, you'd choose it above any other options" which is the whole point, go with the best quality and let the renderers manipulate it as seen fit (engine, browser, phone, print, whatever). Textures are meant to be raw, which is why a lot of engines use RAW formats.

Oshyan

I don't know the details of the Unreal example and without knowing how it was accomplished I don't think it proves anything. The rest of what you've said seems to just be assumption based on a test that you yourself say "I'm not sure what's all in the file or why it's bigger with larger DPI" about, which suggests you don't understand what's going on either. Assuming the cause by the result is bad science. ;)

4096x4096 @ 300 DPI is exactly the same as 4096x4096 at 72 DPI. The only thing that is different between those two files is a simple metadata flag for DPI, which should only be used for printing (if even then as many images have a default DPI setting which isn't applicable to print, and people often choose explicitly the dimensions they want printed). If a game engine actually relies on DPI for something, that'd be a surprise to me, and makes little sense. Can you find any reference to this in the documentation?

- Oshyan

WAS

All I know is DPI is handled in Unreal Engine. You must specify the DPI based on the viewport; a widescreen, a projector, a crt, etc, though this targets mainly the UI overlays. 300 DPI screenshots was recently a feature request and supposedly now enabled with HighResScreenShot.

It may not be needed for most, but in the industry I assume for promotional purposes it's needed. For example my company deals a lot in printing and they would much rather the data come ready then change anything, as it's not a product for people to customize.

TheBadger

I found this in unreal forum:

https://answers.unrealengine.com/questions/105725/texture-size.html
QuoteDots per inch is only useful when you're setting the size of the image in a physical unit such as inches or cm. Changing the DPI then simply adjusts the number of pixels in the image so that print quality can be higher. For example, if you had an image that was 10 inches each way. At 72 DPI, that would be 720x720. At 120DPI, that image would be 1200x1200. Changing the DPI doesn't magically make your pixels more detailed, it just adds more of them. If you specify a resolution and a DPI, then all you're doing is telling it to print the image smaller, not to add more detail.

In short, DPI and pixel resolution aren't really compatible concepts, and you should be concerned with resolution only in this instance, not DPI.

DPI scaling rule
https://docs.unrealengine.com/latest/INT/Engine/UMG/UserGuide/DPIScaling/index.html

Not sure about what this 2nd link is all about.

Never heard anything of this dpi scaling before so interesting I guess.
It has been eaten.

Oshyan

DPI makes some potential sense for *UI Overlays in particular*, because they are always at a *fixed position and distance relative to the camera*. That means DPI *could* be used as some measure of detail relative to the user's display, although given the wide range of modern display DPIs and resolutions it's still something of a crapshoot and specifying UI elements by % of screen space or some other resolution-independent method seems much better to me. Again can you link to any documentation that mentions DPI in the context of Unreal Engine? Note that "DPI Scaling" is *not* the same thing as DPI as used in image settings!
No mention of DPI in the basic texture info, for example:
https://docs.unrealengine.com/latest/INT/Engine/Content/Types/Textures/SupportAndSettings/index.html

What do you mean "it's not a product for people to customize"? Where is this request for 300 DPI screenshots, can you link to it? I'm curious of the details. You understand that the screenshot is at a fixed resolution, and making it possible to make 300 DPI screenshots is just the save algorithm specifying a 300DPI flag in the saved file, right? It changes absolutely nothing about the actual saved image data.
Also no mention of DPI in screenshot settings (even though there is mention of a "highres screenshot", but of course that's not the same thing as high DPI):
https://docs.unrealengine.com/latest/INT/Engine/Basics/Screenshots/index.html

In fact the only mention I see of DPI in their docs refers to DPI scaling in the UI, which again is a totally different thing than what we're referring to here.

- Oshyan

WAS

#28
Quote from: Oshyan on January 08, 2016, 07:01:54 PM
What do you mean "it's not a product for people to customize"?

and making it possible to make 300 DPI screenshots is just the save algorithm specifying a 300DPI flag in the saved file, right?

In fact the only mention I see of DPI in their docs refers to DPI scaling in the UI, which again is a totally different thing than what we're referring to here.

- Oshyan

A game is not meant to be modified by the promotional team (or anyone outside of development besides any development tools made available; for the most part games have specific end-user licenses people ignore like GTAV), so thus having ready screen captures makes things easier I guess.

And again, the images above are both simply upscaled from the same files, one saved with 72dpi, and the other with 300dpi, there is a noticeable change in how it's rendered by UE4 as a prop. I don't know why. Could be the same reason reason Fallout 4 is using a pattern with LOD objects and anything you can approach up close. Something we are not aware of yet in the industry, or coming out. This is also seen in Witcher 3 textures just not as much it seems, only specific things like a paintings texture. However from what I'm reading UE4 renders in 72 dpi despite textures,

And again like I was saying, projectors use DPI scaling, not pixels like monitors or new TVs.

Kadri

1- Will you print it? No: Then don't bother with DPI.

2- Is there any menu like for a game engine? No: Then don't bother with DPI.

3- What will be the screen resolution? 1920x1080 (for example).Will that object or image look bigger (will the camera be closer) then the screen size? No:The biggest image you can use on an object is 1920x1080. If you use a bigger image it is wasted- unneeded.
Will that object look bigger (will the camera be closer) then the screen size? Yes: Then it depends on how close you will get.If you will see half of the image then you will need kind of a 2 size (4K for the same example) to get the same quality at that closeup. If you get closer you will need bigger ones even.

The DPI scaling is relative to the screen size and how close the pixels are shown on an TV,tablet etc. A small 1920x1080 device is harder to read when it does have the same size fonts as on an 32 inch monitor. So the GUI can show the fonts for example bigger or smaller according the DPI scaling number. They could use pixels too for those things but it does have a history behind it that uses DPI. And it isn't wrong but unfortunately confuses people.

For standard in game 3D objects etc. video or an image you make thinking about DPI is like while you are working to make something and use cm,meter to think about how it is in feet,inch etc. They are all related (changeable) but why do you make your work harder why absolutely not needed? Only how close you will get to the object and how big the screen is (in pixels) matters.