PDA

View Full Version : blending texture in relation to camera?


mickna
11-20-2008, 03:32 PM
Hi there,

I hope I can explain what I need.....
- We have a scene with an big object (e.g. a meadow)
- Simple: A huge plane as floor with a grass texture on it.
- This looks fine in the distance - but not near the camera
- A texture with more details looks fine near camera but ugly in distance

Now I want to project a second texture with more details on the plane and reveal it only near the camera with a mask. This mask should be always in front of camera and blend the detailed texture into the bigger one in a specified distance....

Any solutions out there?
thx,
mickna

Sorath
11-20-2008, 10:51 PM
you could use a simple depth shader ..that one which uses sampler info, setrange and multiply node..

or you can pipe a mib_texture_vector into a ramps z- coordinate and use it somehow in screenspace (just a thought) not sure if this works correctly in this case.

or you just use a texture projected ramp from top and parent it to the cam..

you could also render both passes if it renders fast and tweak with a z-depth in comp.

there are several other ways, ..if you're not that advanced in shading then i suggest using the texture projection workflow.

cheers
Bastian

djx
11-20-2008, 11:09 PM
Here's a quick example using sorath's first suggestion.

-- David

mickna
11-21-2008, 09:21 AM
Hi Bastian,

thx for your RE. I think I have now a solution....
I used a samplerInfo, reverse, setRange and a ramp

SamplerInfo.pointCameraZ -> reverse.inputX
reverse.outputX -> setRange.valueX
setRange.outValueX -> ramp.vCoord

works well for me :)
-------------------------------

@david:
Can't see any example - did I miss somethink?


Thanks to you both!
mickna

djx
11-21-2008, 12:49 PM
Looks like I didnt attach it correctly :argh:
Oh well, what you just described is all that it was, except I connected the setRange out to the blender of a blendColors node so you could connect a different texture to each of the color inputs.

Sounds like you have it under control though.

-- David

mickna
11-21-2008, 02:23 PM
Hi David,

well with a ramp I'm able to adjust the blending region and the smoothness of my border...
I think with blendcolor I'm not so comfortable to tweak this....

Again thank you for your time :)
mickna

CGTalk Moderation
11-21-2008, 02:23 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.