Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Pixel Processor sampling and outputting different input sizes to make texture atlas

Community Beginner ,
Apr 30, 2022 Apr 30, 2022

I am working on a graph to build a texture atlas. I looked at Atlas Maker, which seems like it would be great, but it doesn't seem to handle my situation, at least I don't think it does.

 

In my project, I have several graphs to generate different perfectly tiling textures for different parts of my models.  For example, I have a graph that generates a section of a wall that is 128x256 and I have another graph that generates a section of concrete that is 256x256, and another section of stone that is 128x64.

 

I am generating an output texture of 2048 x 2048 and I'm trying to position each of these graph outputs within the overall texture output accordingly, without manipulating them any further.  i.e. I want to put the wall section at 0,0 and it should take up 128x256 pixels. Then I can place the concrete section at (0, 129) and it should take up 256x256 pixels. And so on.

 

When I use the Atlas Maker node from the old substance share, it appears to treat the input images as always the same size as the output.  i.e. Setting an atlas maker node for 128x256 with the wall section input it stretches the input to 2048 x 2048 and then apparently samples the area of 128x256.

 

My attempts to solve my problem where to use a pixel processor, hoping that I could grab an the pixel from the input texture at the same position +/- some offset as the output texture.  For example, grab pixel (0,0) from input and place it at (0,0) of the output, for all pixels of the input without performing any transformation on the input.

 

I'm very new to substance designer, function graphs, and the pixel processor node, so I'm a bit unsure of the logic and variables here, so any help would be greatly appreciated.

 

TOPICS
How to , Substance Graph
624
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 30, 2022 Apr 30, 2022

Assuming these are multi-channel materials you may find it simpler just to cascade material transform and material blend nodes. Make sure the transform nodes use Absolute for their output size.

2022-05-01_00-28-15.jpg

 

Dave

Translate
Community Expert ,
Apr 30, 2022 Apr 30, 2022

Assuming these are multi-channel materials you may find it simpler just to cascade material transform and material blend nodes. Make sure the transform nodes use Absolute for their output size.

2022-05-01_00-28-15.jpg

 

Dave

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 30, 2022 Apr 30, 2022

Hey thanks for the quick reply. This looks like it should work, though trying to implement seems to be escaping me.  My material transform nodes are set with Absolute Output Size of 11x11 (2048x2048) but the input in them seems to be stretched and tiled.  I'm messing around with other settings to see what I need to change to get what you have going on.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 30, 2022 Apr 30, 2022

It seems like I was able to reproduce what you have by editing the transformation matrix. I created a function graph to do the math for it so I can make it a bit more reusable. When I have it working how I like it I'll post it in case anyone else wants to use it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 01, 2022 May 01, 2022
LATEST

For anyone who is interested in a function for editing the transformation matrix a little easier:

 

Adam5FBB_0-1651442145879.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines