3
$\begingroup$

If I add a procedural texture into node Compositor, it became oval, because of Render's aspect ration.

Does exist a way to math a value for Texture > Scale input socket, that take Render aspect ratio into account to correct deformed proportion of texture?

I was able to manually stretch it back with Scale node > Absolute, but it doesn't seem to be the best way for texture quality.

enter image description here enter image description here

I would prefer correct "Scale" on texture node input socket automatically when Render size is changed. (Sorry for different texture type here, I hope its not confusing.)

enter image description here enter image description here

$\endgroup$
1
  • $\begingroup$ It would be best to perform the scale at the texture node, this way the quality will be better than doing it after the texture is generated. $\endgroup$
    – 3pointedit
    Commented Aug 15, 2018 at 13:04

1 Answer 1

4
$\begingroup$

For best quality Scale the texture via texture node the input vector. Use a Combine RGB node to send the correct values. Assuming that the width =1.0. Divide the height by the width for the width factor. e.g. (1080/1920), this will reset the aspect. Use a color curve to scale the vector.

rectify texture aspect

To save you having to type in the current scene dimensions you can set them as a driver in a Value node. First, here is the wrong aspect which Blender simply "fits" to the current aspect, in this example the scene is 16:9 while the texture is 1:1.

Fitted aspect

Add 2 Value nodes

add value nodes

Right click in each node value window and select Add Driver > single from target.

Add driver

Use the proper to choose the scene dimensions.

select driver source

Add a Math Node and set it to divide, then divide the width by the height.

divide dimensions

The X aspect is sent to the vector input via the green register, correcting the distortion of the texture.

aspect corrected

You can add another Math node set to multiply and a Value node to scale the texture after correction.

scale texture by vector

Result

scaled result

UPDATE

To re-use the aspect correction you can collect them into a Group Node. Beware that the drivers (in groups) fail if you change dimensions of the scene. If you need them to be dynamic then I suggest just copy and pasting the collected set of nodes, excluding the texture node of course.

Select the Value, Math and Combine RGB nodes and press Ctrl G to set them as a group.

Make group

Press the Tab key to step out of the group node and label it so that you can locate it later.

name group

To add the group elsewhere in your nodes, Add a node and choose node group > (your node group name)

add group

Attach it to your texture.

add to texture

Remember that drivers will fail inside a group node, so they cannot change dynamically.

$\endgroup$
2
  • $\begingroup$ Thank you, scale texture with RGB is cool - its directly updated, changing texture size in texture prop. panel I need to go frame +/-. BUT ... anytime i change aspect ration of render I need to divide size again. I want to let nodes math it automatically. I want to save a node group with Vignette. Anytime I append the group I want to connect it without care what current aspect ratio render use. SO ... Is there a way to let some nodes read size of render from render properties panel? $\endgroup$
    – vklidu
    Commented Aug 15, 2018 at 13:53
  • $\begingroup$ Just stick math in front of the RGB combine node. I didn't, just for speed of reply. EDIT: Oh I see... you might be able to access the scene dimensions as a driver value but drivers in Nodes are notoriously flaky. You might have to set a scene variable as a Value node at the start, sorry. $\endgroup$
    – 3pointedit
    Commented Aug 15, 2018 at 22:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .