Home Adobe Substance

Transformation 2D offset function?

polycounter lvl 7
Offline / Send Message
Mr.Moose polycounter lvl 7
I've created a pixel processor following the video provided by Allegorithmic, and I am working on trying to offset a transformation 2d to match the offset of the pixel processor

So I'm trying to grab the X and Y of the grid position of the selection (Of the processor) and offset the transformation based on that

Which...

Isn't working at all. Does anyone have a resource or guidance on this? I feel like its at the tip of my fingers!

Replies

  • NicolasW
    Options
    Offline / Send Message
    NicolasW polycounter lvl 13
    Not sure I get what you're trying to achieve, can you illustrate (with images) the problem ?
  • Mr.Moose
    Options
    Offline / Send Message
    Mr.Moose polycounter lvl 7
    NicolasW wrote: »
    Not sure I get what you're trying to achieve, can you illustrate (with images) the problem ?

    I meant to do that today, Figured I wasn't being clear enough. Will update this post tomorrow and explain as well as I can ^.^!
  • Mr.Moose
    Options
    Offline / Send Message
    Mr.Moose polycounter lvl 7
    Okay, So I followed the pixel process tutorial and created this
    http://i.imgur.com/GlLITFM.png

    Now I want to expand off the pixel process tutorial and create a transformation 2d that basically "zooms"/scales the pixel shown so that it can be used as a 512 (since a 4k texture is unusable as a brush size)

    So I've taken a transformation 2D, created an offset function for it to follow the pixel processor, but since it accepts only roh and theta for position it has to be done a little differently. Now I have it where the roh and theta each equal the cell cordinate, but it just kind of.. arbitrarily offsets the position.


    http://i.imgur.com/eXMdwcj.png

    I imagine I just have to manage to get it to center each different selection so I can have an absolute value for scale to "zoom" and make it a 512. I know its possible, but I can't find any videos or documentation on it, and being new to creating functions in SD..I didn't really think it was going to be as frustrating as it is :P


    ETA: I think I have the logic wrong. Trying to approach it a different way, blah
  • electricsauce
    Options
    Offline / Send Message
    electricsauce polycounter lvl 11
    Here's one I made using a standard transform node. It's capped at 2k but you should be able to adjust it for higher resolutions. If you plan on using it for Unity (or anything that uses the CPU rendering engine) you can't use 4k anyways.
  • Mr.Moose
    Options
    Offline / Send Message
    Mr.Moose polycounter lvl 7
    So the example you showed, just takes the center and scales it up at any size up to 2k, correct?
    What I am -attempting- to do is for each of these brushes is to move the transform over.. Your post helped, and I might be able to apply some of it but I still have to figure out this offset :|

    So like small brush in corner, and then next brush appears to the right and so on etc. Scale them up and use them as 512x
    qK7Z29y.png



    So I need to take my transform and offset it 512 horizontally for each column and then 512 vertically for each row.. Since the selection is 1-64 it would be something like if selection = 4 then x +512(4) y + 0 offset or if selection equals 9 offset x + 0 and y + 512(1)

    Something.. Maybe I should just wait until finals are over and figure this out.
  • electricsauce
    Options
    Offline / Send Message
    electricsauce polycounter lvl 11
    There is a variable on that substance that allows you to shift the zoomed image around. What you'll have to do is set an input variable (integer) and multiply that by another variable defined by the zoom size to get to the grid section you want.

    The sbs I posted is meant more for extracting smaller textures from a larger one with the purpose of tiling them afterwards.
  • Mr.Moose
    Options
    Offline / Send Message
    Mr.Moose polycounter lvl 7
    Okay, I will try to do so ^.^

    Thank you :)

    I am still unfamiliar with functions, but learning a good bit with this project lol
  • electricsauce
    Options
    Offline / Send Message
    electricsauce polycounter lvl 11
    I forgot That I needed to add my functions substance to the link. I made a custom clamp function that used in the transform2doffset node which is why the patternoffset variable didn't work.

    https://dl.dropboxusercontent.com/u/9194933/Substances/Functions.sbs
  • Mr.Moose
    Options
    Offline / Send Message
    Mr.Moose polycounter lvl 7
    hahaha okay! That might be why I was confused on how to make it offset..
  • Mr.Moose
    Options
    Offline / Send Message
    Mr.Moose polycounter lvl 7
    Finals over. Continuing trying to figure out creating functions in substance designer.

    @electricsauce thank you for the second .sbs, but Its hard to understand because its only the functions, not attached to anything so I do not exactly know what each is doing.

    Going to continue to try and hammer this out. I am thinking having a big if - else statement should work. I'll try to get one to show by the end of this week.

    To re-elaborate what I'm doing I am trying to take any part of this pixel processor and offset it to be dead center. I tried a couple unsuccessful ways of doing this, and will try the super long route of making 8 if-else statements per line trying to offset the texture

    81WKXHV.png
Sign In or Register to comment.