Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[BUG] Incorrect INT Array With random_value_array Node

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
sachinshrestha
551 Views, 2 Replies

[BUG] Incorrect INT Array With random_value_array Node

Didn't see this reported and I think this is a bug. When trying to generate random int array with the random_value_array node it generates an incorrect array. It works for floats and vectors as seen below for color and point_weight properties but int seems to throw it off.

 

I have attached a repro file and below is the sample output from dump_object node:

 

{
    color: 
    {
        data: [ {0f, 0f, 0.191406f}, {0.883475f, 0.0909845f, 0.010106f}, {0.601288f, 0.303908f, 0.340763f}, {0.693503f, 0.690186f, 0.966893f}, {0.955312f, 0.328933f, 0.108635f}, {0.266847f, 0.606706f, 0.446026f}, {0.909755f, 0.761201f, 0.899103f}, {0.220241f, 0.568628f, 0.733788f}, {0.0256232f, 0.532579f, 0.338461f} ] 9 elements (array<Math::float3>)
        default: {0f, 0f, 0f} (Math::float3)
        depends_on: [  ] 0 elements (array<string>)
        interp: 0 (int)
        target: point_component (string)
    }

    instance_id: [ 10, 5627048460301331259, 5606117981059482272, -5763567894284256181, -795853604685197894, 4922451004835648574, -1895045473117712093, -5123359586688034574, -4910742660364158869 ] 9 elements (array<long>)
    point_component: 
    {
        count: 9 (uint)
    }

    point_position: 
    {
        data: [ {-12f, 0f, -12f}, {-12f, 0f, 0f}, {-12f, 0f, 12f}, {0f, 0f, -12f}, {0f, 0f, 0f}, {0f, 0f, 12f}, {12f, 0f, -12f}, {12f, 0f, 0f}, {12f, 0f, 12f} ] 9 elements (array<Math::float3>)
        default: {0f, 0f, 0f} (Math::float3)
        depends_on: [  ] 0 elements (array<string>)
        interp: 0 (int)
        target: point_component (string)
    }

    point_weight: [ 0, 0, 0.191406, 0.883475, 0.0909845, 0.010106, 0.601288, 0.303908, 0.340763 ] 9 elements (array<float>)
    render_settings: 
    {
        viewport_geometry_shader: 
        {
            TEXCOORD0: 0.25 (float)
            material_definition_name: point_shader (string)
            material_definition_type: pointToDisk_screen (string)
            point_size: 0.25 (float)
        }

    }

}

 

Doesn't seem like the expected output to me. Can somebody please confirm whether this is a bug or I'm missing something here?

 

Cheers,

Sachin

 

LinkedIn: https://www.linkedin.com/in/sachinshrestha/
Twitter: https://twitter.com/_sachinshrestha
Instagram: https://www.instagram.com/noizfactory/
SoundCloud: https://soundcloud.com/noizfactory
Tags (2)
2 REPLIES 2
Message 2 of 3

Random value array, when used with an integer type, generates random integers between the int minimum and maximum. With a 64 bit integer, those are the types of numbers you get... 

 

To get values that are more in line with what you want - I would generate random floats, which will be in the 0-1 range - then pipe those through a lerp (linear interpolate) where you select your min and max values, and then convert those to the integer type you want (in this case - long). 

 

image.png

Jonah Friedman
Bifrost Product Manager
Message 3 of 3

Thanks Jonah, that makes sense. I wasn't paying attention to the actual integer type on the value so now its certainly inline with the type I had on it.

 

Cheers,

Sachin

LinkedIn: https://www.linkedin.com/in/sachinshrestha/
Twitter: https://twitter.com/_sachinshrestha
Instagram: https://www.instagram.com/noizfactory/
SoundCloud: https://soundcloud.com/noizfactory

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report