filter specific colour values from one image map shader

Started by drongo, March 27, 2011, 03:30:32 PM

Previous topic - Next topic

drongo

Hi,

to minimize the number of image map shaders/the amount of memory in my scene and to allow me to use image map shaders with a higher resolution, I thought using one single image map shader would be nice. I would like to have one specific grey value for every shader I like to blend. For example 100 for Birch Trees and 200 for Beech Trees and so on (the areas don't overlap).
Then I would like to extract the values from the image. But I can't find a filter function. I am using the clamp function now. But it seems a little bit complicated.
- place image map shader with many different grey values (in the example one forms the number 100 and one 200)
- deselect "Smooth interpolation" as well as the converting to linear option in the Colour tab
- this image goes in different hard step scalar functions, two for each surface layer/population
- this hard step function does not allow simple numbers, so I need to add a Constant Colour function to each hard step scalar
- my first hard step scalar removes everything before a specific grey value and leaves everything above
- the second removes everything lower than and including the value itself
- than I subtract the results and get the colour of the small section of values and use it as blend shader
I need to know the specific Colour value for each of my grey values. And this is strange. In my example (see below) I have two numbers, one written with the grey value of 100 and one with the value of 200. But the Constant colour needs to be between 0 and 1. I thougt 100 would be 0.39 (because of 1 / 256 * 100), but actually I found it to be 0.25. What is this? I deactivated the Colour Converting in the Image Map Shader.
And I need to be exact. If I take 0.2 for the lower colour and 0.3 for the higher one, I get my 100-number but also a small line around the 200-number.

Well, as you can see, it works, but is very complicated. Any idea how to make this more easy. I dont like the idea to subtract areas. There might be fragments.
I attached a screenshot and my .tgd-scene.

Greetings,
Drongo

mogn

The hardstep operator converts the color from the imageshader to a scalar: scalar = sqrt(3)*Grey_value.

To avoid the conversion put a "X to scalar" after the imageshader, and use this for input to the rest of the nodes.

Matt

Quote from: mogn on March 28, 2011, 03:45:05 AM
The hardstep operator converts the color from the imageshader to a scalar: scalar = sqrt(3)*Grey_value.

To avoid the conversion put a "X to scalar" after the imageshader, and use this for input to the rest of the nodes.

To avoid ambiguity, I would use the 'scalar' version of these functions.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

drongo

That doesn't change anything. I use x to Scalar, Constant Scalar and Subtract scalar. There are still fragments, when I don't find the exact value. And the grey values are still strange (0.25 instead of 100).

Greetings,
Drongo