Filtering on gradient ramp maps

Good day everyone,

I have encountered a problem when rendering gradient ramp maps in 3ds Max 2020 and V-Ray Next 3.1.
The map is applied to a cylindrical body, and depending on the camera location, the sides are all blurred and out of aligment. If the camera is perpendicular to the stripes everything is perfect, but angle the camera just right and the map is smudged all over the place. This doesn’t happen with a bitmap. I’ve tried different filtering methods (image below is VRayLanczos at 2,0) but this happens with all of them.

I can’t seem to repro the issue here.
It’s best if you send the piece of scene shown here, the exact v-ray version, and a link to this thread, to support (@chaosgroup.com).

I think its the gradient’s mapping. I managed to produce similar results with a simple 90-degree rotation of the Ramp or with a Planar UVW map. Arnold seems to produce similar results. Increasing the cylinder sides, changing the coordinate system orientation (UV to VW worked well), or lowering the Ramp’s blur seems to mitigate the issue. Do attach the scene here or send it to support as already mentioned.

I indeed used a standard cylinder with its (cylindrical) mapping, and rotated the gradient 90deg. on W.
The UVs do look good, though, seeing the other bitmap.
But it could be they are not that simple, and the bitmap masks issues the gradient highlights (f.e. if the UV has broken up atlases, and such.).

Thinking that a bitmap would solve the problem, I rendered the scene with it, and while less apparent, the smudging/blurring is still visible.
I uploaded a test scene; please ignore the missing XRef error, a link left something I can’t quite locate…the zip scene also includes a comparison with mentalray and the result I would expect from either a gradient ramp or a bitmap.
HandleTestScene.zip (1.31 MB)

It’s got to do with the UVs (they aren’t straight. try with a uvwunwrap, you’ll see).
Arnold renders it identical, and the bitmap too shows issues when looking at the geo from a different angle than that of the camera.
The issue is directly visible within the viewports, as well.

I just tested this and it works perfectly well if you simply reduce the blur, which in the image above is set at 1.0
All I did was take it to .01 and the it as sharp as one would expect.
That aside, what it does do with the blur is very odd indeed and looks like it has something to do with the ramp itself - it blurs it in a very unexpected way, heavily biased toward the sides.
I tried a bitmap of the same stripe and the blur is as expected.

Here is a comparison - very weird ramp stuff. More segments = smoother blur but it’s still completely borked :stuck_out_tongue:

Yep, filtering will reveal the issue with distorted UVs.
The bitmap as well gets filtered unevenly because of that.
It’s much better to fix the UV map, though, rather than reduce filtering.

Yeah it’s clear that bad uvs will make it a bad result but my example is on a primitive, with or without its own generated coords.
So it is the ramp or its implementaion that is inherently broken in some way, it seems.
Not a Vray thing though, so probably not anything that can be done about it.

EDIT: I just noticed that it only seems to happen when the ramp is set to solid, so if keys are added close enough together to recreate the ‘solid’ appearance then the problem goes away and the blur can be left at default.

Standard max map filtering (pyramidal) is simple and poor in results.
Summed area is marginally better, at the cost of speed and RAM, but is unavailable for procedurals.

Here, i simply added a cylindrical UV and (kinda.) lined it up with the stem (left one.).
Issue gone.


Briareos, take a look at the workaround I post above. Make your ramp not solid but linear, then put two markers close together where the colour changes.
As long as your uvs are ok this will be the best result I think.
In your image it’s still warping the map/ramp at the edges.

I read that, but and I want to keep the gradient with solid interpolation because Max’s gradient ramp is finnicky and adding many points too close together will be a nightmare to maintain/modify.

I solved the warping above by reducing the blur to 0.2 (image is 1.0). It’s good enough for what I want and keeps the gradient simple. Win win :slight_smile:

Thanks again.

Fair enough :slight_smile:

It’s not V-Ray, it’s what Max passes the renderers, *any* renderer.
mR would do the same under the same circumstances, just like Arnold, or ART.
The UV stretching in turn produces texture stretching, and because the procedural should be “solid”, or a sharp line, but it’s highly distorted, you end up seeing the feathered stuff: an attempt from Max to reconcile the two.
The bitmap too is looking wrong: look behind your geo (as seen from the camera view) and you’ll see it.
Just that because it’s not a procedural set to “solid”, the distortion isn’t so obvious and the front part looks about fine.
Reducing filtering will reduce the visible issue, but will create others in turn (especially when animating fine detail.).
You really are much better off (in pipelining principles, that is.) tightening the I-O process (if you are lucky enough to be able to do so), or the data prepping (if you ain’t so lucky.), so that the model comes in with proper UV and proper transforms (try zeroing rotations on yours, and you’ll see what i mean.).

Apart from that Lele, any idea why the solid interpolation gives such alarmingly weird results even with perfect UVs? I know it’s not Vray but universal it seems.
Even though my workaround…works, it’d be interesting to know :slight_smile:

But it didn’t, in Max 2014 and 2015. That’s why that blurring/smudging/warping was so strange to me, and why results between gradient and bitmap (wih the same mapping and blurring) were so dissimilar.

The model is a mess, I know. It’s imported from an STP model and to move components around I use helpers, simply aligning components’ pivots to the world and centering to them. Unfortunately time constraints don’t allow for much more finesse in managing it.

Oh, nice, i’d love a look at that mR scene, do you still have it laying around?
Maybe mR treated procedurals differently (i.e. no filtering, regardless of settings), i’d be curious to check it out on the piece…

Edit: ah, sorry to hear about the constraints with data prepping. I was always very happy when there was a department doing it for me, this much i can tell you. :stuck_out_tongue:

Set the blur value to 0.01, it will be fine afterwards.

I still have it, but I cannot distribute it. However, the object used in the mR scene, as well as the gradient ramp, are the same. The camera is a standard 2015 3ds Max camera, with the same FOV as the camera included in the package. These are the render settings: