gama-platform / gama

Main repository for developing the 2024+ versions of GAMA
https://gama-platform.org
GNU General Public License v3.0
26 stars 5 forks source link

Facet 'width' makes polylines not planaries, and is applied to the rotation sphere #31

Open tnguyenh opened 1 year ago

tnguyenh commented 1 year ago

Describe the bug I've got a few issues using the facet 'width' with polylines.

  1. Using width results in a non-planar line. Actually it appears to be a rectangle, with an angle with horizontal that changes depending on the view point. In the following picture, the blue and green lines use width. The green line also as a depth facet. The width is not applied to the green one, the blue one is rotated.

image

  1. When setting width to a polyline, it is also set for the rotation sphere.

image

  1. The unit used for width seems unconsistent with other units. Yellow and green lines have a depth of 10. Blue and green lines have a width of 200.

To Reproduce Use the following code:

model width_polyline_bug

global{

    geometry shape <- polygon([{0,0},{0,100},{100,100},{100,0}]);

    init{
        create dessin{
        }
    }   
}

species dessin{
    rgb color;

    aspect default{
        draw world.shape color: rgb(#pink,0.9);
        draw polyline([{10,10},{90,10}]) color: #purple;
        draw polyline([{10,30},{90,30}]) width: 200 color: #cyan;
        draw polyline([{10,60},{90,60}]) depth: 10 color: #yellow;
        draw polyline([{10,90},{90,90}]) width: 200 depth: 10 color: #green;
    }
}

experiment essai type: gui {    
    output {
     display "My display" type: opengl { 
        species dessin aspect: default;
     }
    }
}

Gama 1.9, opengl

AlexisDrogoul commented 1 year ago

width works for me as intended and I can't reproduce your issues on macOS M1 (except the sphere thick lines, which I solved). Since the width of lines is not a mandatory feature of OpenGL, I would suspect this is entirely up to the graphics card driver to do anything... Same problem regarding the units: some cards accept 1 to 10, some only 0 to 1... Difficult to understand what 'units' this represents

lesquoyb commented 10 months ago

I also have that problem with width: image

Maybe it's windows specific ?

AlexisDrogoul commented 10 months ago

I don't think it is linked with the OS -- more probably with the graphics card. As I was saying, this definition of line width is highly dependent on the implementation of the OpenGL pilots on each card. See for instance https://stackoverflow.com/a/34867791/1109459

lesquoyb commented 4 months ago

Then what about adding an info or a warning that rendering may depend on the computer's implementation of opengl ?