PDA

View Full Version : Image Crop Surface Editor Node



gamedesign1
12-30-2017, 01:33 AM
Hi All

Does anyone know if there is a node plugin that will crop an image in the surface node editor?
I have an image that I only want to use a part of and then have that repeat. For example lets say I have an image that is 1000px X 1000px but I want the image node to only use 750px X 750px of it.
Is there something that will do that? Native or Plugin?
Thanks :)

Sensei
12-30-2017, 02:12 AM
Literal cropping of image would require allocating new image, with new size, and copying data from one to another.
Such operation should not be done during rendering.
It would be no problem making tool (LayoutGeneric) which would take image as argument, and user would specify range, press button and have new image created.

ps. The first thought was: way not use UV for specifying which part of image is interesting to user...

probiner
12-30-2017, 02:54 AM
Like Sensei mentioned, you can't crop the image data, but you can crop the mapping positions, in this case I'm doing this using the Image node Position input and the Opacity input to switch to something else (red). Scene at: http://jmp.sh/MWNfPo9

This is something the Image Node itself could include, since while it's simple it can be considered convoluted the way it's being presented here.

https://i.imgur.com/Xc9mecL.gif

gamedesign1
12-30-2017, 03:16 AM
Literal cropping of image would require allocating new image, with new size, and copying data from one to another.
Such operation should not be done during rendering.
It would be no problem making tool (LayoutGeneric) which would take image as argument, and user would specify range, press button and have new image created.

ps. The first thought was: way not use UV for specifying which part of image is interesting to user...

Hi Sensei, thanks for your reply :)
This might be difficult to explain what I am doing and probably doesn't make any sense any way, but here goes haha
I was trying to think of a way of creating a brick pattern that doesn't tile (well least for quite a while anyway), so you can use it for close up shots and very wide shots.

So I have created a mask image that has some random bricks masked out on every other row. And then I have creaed another version of the mask that is cropped at 3/4 of the image. I have then screen blended them together with the smaller one scaled at 75% of the other, so they when they tile the bricks will have the same weave but will have an offset tiling. I hope this makes sense as its quite hard to explain. So then I was thinking that well wouldnt it be even simpler if it was only one mask image, but the second image instance of it was only using 75% of it. I know I might not be making much sense, but I was just trying to make a random brick pattern node that was easy to use. I appreciate that I may not be going about it the best way, but I was just trying it out as an experiment. Here is the surface and images zipped up if you wanted to take a look.

138995

gamedesign1
12-30-2017, 04:11 AM
Like Sensei mentioned, you can't crop the image data, but you can crop the mapping positions, in this case I'm doing this using the Image node Position input and the Opacity input to switch to something else (red). Scene at: http://jmp.sh/MWNfPo9

This is something the Image Node itself could include, since while it's simple it can be considered convoluted the way it's being presented here.



Thats so much for your help, thats a great technique, but I don't think that helps with what I am trying to do here.

probiner
12-30-2017, 07:46 AM
Why the different size of the masks? You could get a bunch of them and apply them in a random fashion to different tiles. Or attribute to individual bricks on the texture a ID and mix with repeating tile ID and randomize it.
https://streamable.com/50l2p

The best way to go about it would be to have the position of the bricks and use that to randomize position, that way you could even have a tiled procedural look. I had to to actual polygons for this one...
https://streamable.com/70mli

gamedesign1
12-30-2017, 07:58 AM
Why the different size of the masks? You could get a bunch of them and apply them in a random fashion to different tiles. Or attribute to individual bricks on the texture a ID and mix with repeating tile ID and randomize it.
https://streamable.com/50l2p

The best way to go about it would be to have the position of the bricks and use that to randomize position, that way you could even have a tiled procedural look. I had to to actual polygons for this one...
https://streamable.com/70mli

There is clearly something I am missing from LightWave's native nodal capabilities. How are you changing the different bricks to have different colours randomly? Are there any tutorials that you could point me to, to explain how this works? Thanks so much for pointing me in the right direction :)

probiner
12-30-2017, 08:17 AM
In the first one I painted another texture with integer values for each brick: 0, 1, 2, 3, 4 and mixed it with the tile integer value [x, y] to create a sort of unique ID that I can then use in a node like "Random Scalar" and "Color Tool". It's a pure texture solution.

In the second one I did need to cut some rectangles shaped like the bricks so I could get a Position per brick out of them. And with a Position you can do more rich things like remapping a procedural into whole bricks or the previous solution of a single ID. More flexibility. Instead of using real geometry you could always bake a position map and then offset that position with the tiles position.

Yeah, LW won't be a substance designer, but surely with the right ideas you can implement neat solutions.
As for material about this there's not much out there I do touch it a little bit in my nodal setups tutorial series from which the videos alone I plan to make public soon.

Cheers

gamedesign1
12-30-2017, 08:32 AM
In the first one I painted another texture with integer values for each brick: 0, 1, 2, 3, 4 and mixed it with the tile integer value [x, y] to create a sort of unique ID that I can then use in a node like "Random Scalar" and "Color Tool". It's a pure texture solution.

In the second one I did need to cut some rectangles shaped like the bricks so I could get a Position per brick out of them. And with a Position you can do more rich things like remapping a procedural into whole bricks or the previous solution of a single ID. More flexibility. Instead of using real geometry you could always bake a position map and then offset that position with the tiles position.

Yeah, LW won't be a substance designer, but surely with the right ideas you can implement neat solutions.
As for material about this there's not much out there I do touch it a little bit in my nodal setups tutorial series from which the videos alone I plan to make public soon.

Cheers

Thank you. Something just isn't clicking yet form what you have said, but I will keep reading it and hopefully the penny will drop. I would really like to see those videos :)

probiner
12-30-2017, 08:55 AM
Yeah this could be fully texture solution if I bothered to cook a position texture instead of using the polygons you see in OGL, but can't be bothered :)
https://streamable.com/a6bya

Cheers

gamedesign1
12-30-2017, 09:11 AM
Yeah this could be fully texture solution if I bothered to cook a position texture instead of using the polygons you see in OGL, but can't be bothered :)
https://streamable.com/a6bya

Cheers

I am mostly interetsed in methods without creating polys for every brick

probiner
12-30-2017, 09:44 AM
This is what an Position Map looks like
https://streamable.com/2ujjg

gamedesign1
12-30-2017, 09:48 AM
I would love it if the nodes allowed you to be able to generate shapes and ways of duplicating them based on UV space etc, affecting size, position and rotation etc purely just from nodes.

probiner
12-30-2017, 09:56 AM
This is what an Position Map looks like
https://streamable.com/rg8m3

Asticles
12-30-2017, 10:07 AM
this is what an position map looks like
https://streamable.com/rg8m3

wow

gamedesign1
12-30-2017, 10:09 AM
This is what an Position Map looks like
https://streamable.com/rg8m3

Its really good, I would just like to hear someone talking through it all, so I can get the principles in my head :)

jeric_synergy
12-30-2017, 11:31 AM
Rather than what Probiner demonstrates, couldn't one do something similar tieing the corners of a UV map to nulls? Instead of cropping the image, you'd position the UV map interacively.

gamedesign1
12-31-2017, 03:08 AM
Rather than what Probiner demonstrates, couldn't one do something similar tieing the corners of a UV map to nulls? Instead of cropping the image, you'd position the UV map interacively.

Thanks, but I personally don't want to have to use nulls generate a random brick pattern :) Just seems like a lot of faffing :) The other issue is even if I controlled the UV to show a portion of the image only, would it be able repeat at where the crop is? so it repeats 75% of the image. I really like what I am seeing of your method Probiner, I look forward to your video tutorials explaining it :)

probiner
01-03-2018, 09:14 AM
Yeah, my videos don't explain this particular problem, but some of the pieces to solve it are there.

https://www.youtube.com/playlist?list=PLJ5WaNa5hlYQ6H9rGTjmF0PAYovQv8KV_

Check
- Texturing Positions
- Repetition
- RandomWindows

gamedesign1
01-03-2018, 03:55 PM
These look great, thanks for sharing :)