About Store Forum Documentation Contact



Post Reply 
Setting Heightmap material
Author Message
aceio76 Offline
Source Licensee

Post: #1
Setting Heightmap material
I'm trying to replace a material within a newly created heightmap, and I've used Heightmap.setMaterial() or Heightmap.addMaterial() but it always blends 50% max, rather than replace. It didn't matter what mtrl_blend values I used, it never replaced the material at the heightmap coordinate.

I've used:
MaterialPtr newmtrl=xyz
hm.addMaterial(x, y, newmtrl, 1)
or
hm.setMaterial(x, y, newmtrl, null, null, Vec(1,0,0))

Is there a right way to replace a material at a heightmap coordinate?
(This post was last modified: 06-16-2017 09:40 AM by aceio76.)
06-16-2017 09:39 AM
Visit this user's website Find all posts by this user Quote this message in a reply
aceio76 Offline
Source Licensee

Post: #2
RE: Setting Heightmap material
It didn't matter if:

hm.setMaterial(8, 16, bmtrl, null, null, Vec(1.0, 0, 0));
hm.setMaterial(8, 16, bmtrl, null, null, Vec(0.1, 0, 0));

I get the same blended mtrl. What is the right way to apply a new mtrl to a newly created heightmap?

But I'd really like the new material to basically replace the starting mtrl at the specified coord and not blend with the existing. Should this be possible?
   
(This post was last modified: 06-18-2017 12:33 AM by aceio76.)
06-17-2017 11:33 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Setting Heightmap material
Hi,

I think the blending that you see is just with the neighbor area pixels.

Quote:MaterialPtr newmtrl=xyz
hm.addMaterial(x, y, newmtrl, 1)
or
hm.setMaterial(x, y, newmtrl, null, null, Vec(1,0,0))

Is there a right way to replace a material at a heightmap coordinate?
Both of these methods are correct.
06-18-2017 09:59 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Source Licensee

Post: #4
RE: Setting Heightmap material
Thanks. While I still couldn't get setMaterial() blend values where it is acceptable, using addMaterial() with higher blend values work well enough.
06-27-2017 05:28 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply