Image masking using through camera projection, how to?

Started by Tangled-Universe, December 18, 2007, 03:56:11 PM

Previous topic - Next topic

Matt

Quote from: Tangled-Universe on May 08, 2008, 01:08:06 PM
So in conclusion I'd have to paint a mask then resize it to a square image and then resize it back in TG2 using those factors?

The mask doesn't need to be a square image, it can be whatever size you want. You probably want it to have the same aspect ratio as your projection (4/3 for example) so that you have roughly square pixels after all the projections have been setup correctly. None of that will affect how large the image appears in Terragen, however, because that depends on the projection settings.

In summary, the size of your image map in Photoshop makes no difference to how much of the screen it covers in TG, only how much resolution you get from the image.

Terragen then takes that image and maps it to an area which you specify. It would cover the same area even if you only painted a 1x1 pixel image. It's important for a renderer to be independent of texture resolution like this.

For front projection, let Terragen figure out the render aspect ratio and leave the projection size setting at 1 1. To do this you need to leave the camera connection empty. For projections which need to use a different camera, you'll need to tell the Image Map Shader what the projection size is, because the camera is assumed to project a square field of view. 1 1 would project a square. Usually if you are projecting from some other direction you have different needs anyway, so you would need to think about your aspect ratio more carefully.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Matt

An addition I could make is an aspect ratio control on camera nodes. However, I have chosen not to do this because it might be confusing when there are different aspect ratio settings in a render which uses that camera.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

T-U, thanks for the files. I will look at the crashes.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

bigben

Thanks for clearing tha up Matt. Makes sense now  :)

Matt

I have just found the source of the crash in the Image Map Shader. This is the crash that would happen when rendering or previewing the shader with "Through camera" projection but without any camera attached. This is the default setup, so it could also crash when you first created and previewed the shader.

This is now fixed for future updates.

One way to work around this problem in the current version is to temporarily attach any camera to the Image Map Shader's camera input and then disconnect it again (this correctly resets the internal value that was causing the problem). Unfortunately that may not be possible when loading from an existing file.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Tangled-Universe

I'm glad you've found the source and that it will be fixed in future updates.
For now on I'll try to figure out other ways or make use of your work-around.
I could always save the image-map as a clip or remember its settings and insert it prior to rendering, think that should work also :)
Thanks Matt!

Martin

Matt

Quote from: Tangled-Universe on May 23, 2008, 05:36:29 AM
I could always save the image-map as a clip or remember its settings and insert it prior to rendering, think that should work also :)

If you pause the preview before inserting the clip, you should be safe.

Matt
Just because milk is white doesn't mean that clouds are made of milk.