![]() |
|
#1
|
|||
|
|||
You can also put the same texture in another map channel and repeat it on a larger scale, possible even rotated.
Code:
tex = node.getTexture(unit=0) node.texture(tex,unit=1) node.texblend(0.2,unit=1) trans = viz.Transform() trans.setScale([0.2,0.2,0.2]) trans.setAxisAngle(vizmat.EulerToAxisAngle(0,0,45)) node.texmat(trans,unit=1) |
#2
|
|||
|
|||
Hi JvdBosch,
What does the trans.setScale([0.2,0.2,0.2]) do. Does it rescale the node or the texture map? In my code, I have more than 2000 small ground patches (2m x 2m) with the same texture. I have another huge ground patch (100m x 100m) which has a different texture. My question is whether I can blend the two textures as if they were applied to the same node (i.e. the 100m x 100m patch), using the texblend function you suggest? |
#3
|
|||
|
|||
The setScale indeed rescales the copy of the texture, to be re-applied to the node and blended with the original texture.
I don't get your second question... Could you clarify it? |
#4
|
|||
|
|||
My understanding of the node.texblend() method is that it blends the two texture layers of the same entity. In my case, it is the ground. If the ground is only a single entity, this might work. However, the grass texture I have only matches 2 m x 2 m area (if you apply it to a larger area, it looks not real). To have a larger area of grass field, I have to repeat the ground patch (in my case, more than 2000 repeats). Although the texture itself is seamless (it is amazingly made), it contains both high spatial frequency and low spatial frequency components. The high spatial frequency component will make the repeated ground contain noticeable linear perspective cue. It is trivial for most VR applications, such as games. But, it is not good for some spatial perception experiments, because the real grass field do not have such a strong linear perspective cue. The trick I used here is to superimpose a huge texture (the 100m x 100m patch), which only contains low frequency component. This will substantially reduce the noticeable linear perspective cure. See the attached screen shots for comparison. To do this, I used the node.alpha() method. My question is whether the node.texblend() method can accomplish it as well.
Last edited by Zhi; 04-18-2011 at 09:06 AM. |
#5
|
|||
|
|||
What happens if you use my code on your grass node, without superimposing this other texture?
Another option is a blend-shader which blends according to the distance to the viewpoint, to keep close sharpness. |
#6
|
|||
|
|||
Seems not help with your code (see attached screen shot). I assumed the "node" in your code is the "ground" in my code.
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to make a nice grass field? | Xianshi Xie | Vizard | 1 | 07-01-2009 12:26 PM |
Multiple Textures for Diffuse and Specularity Shader Issue | shivanangel | Vizard | 1 | 05-11-2009 10:44 AM |