Notifications
Clear all

[Closed] renderMap() Scale to match Thumbnail Render

When using renderMap() via MAXScript on a procedural texture that is using Object or World Mapping, the rendered bitmap is not correct at all times.

For example, if you make a Perlin() texture in Slate and right-click and choose Render Map, you’ll get a render that matches that texture’s thumbnail/slate preview. However, if you use renderMap() via MAXScript on the same texture, you’ll sometimes get a very different result.

Here is an example:


clearlistener()
d = Perlin_Marble()
m = Standard diffusemap:d showInViewport:true
example  = Box material:m mapcoords:true
select example
rendermap d display:true

Now select the material in Slate and right-click the diffusemap–and choose Render Map.

How do you force the MAXScript to render identically to what you get when using the Right-Click Render Map function.

Apparently, the UI implementation uses the renderMap scale parameter and does some offset. How can this be replicated?

More bizarre… is that it is random. Sometimes the renders are what I expect, sometimes they are different. So really, I’m not sure what is the root problem in what I’m experiencing.

2 Replies

Doesn’t this work for the Perlin Marble map?

rendermap d display:true scale:200 size:[240,240]

I should have made it more clear. Passing a scale can work.

The question is really how to force a rendermap() call in MXS match what the user would get if using the manual call via Render Map. In other words, how to force the scale to match what the Render Map call uses. If always passing a scale of 200 works, fine… but is that the value that always works? If so, why? I was passing 256 earlier and it was about the same–except offset in U/V by what appears 0.5 or 0.25.

How do you calculate the values to use and match these?