View Issue Details

IDProjectCategoryView StatusLast Update
0029031CommunityOCCT:Visualizationpublic2017-09-29 16:29
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version7.1.0 
Target Version7.2.0Fixed in Version7.2.0 
Summary0029031: Visualization - Prs3d_Drawer::SetShaderProgram() has no effect
Descriptionhttps://www.opencascade.com/comment/20057#comment-20057
> It seems to me that shader program don't work. What am I doing wrong ?

Prs3d_Drawer::SetShaderProgram() has no effect in some cases, because implementation ignores HasOwn*** flags (which should be removed, but till that moment they should be properly handled).
Steps To Reproduce
const char vertexShader[] =\
           " void main()""\n"
           " {""\n"
           "    gl_Position  = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * occVertex;""\n"
           " }";

const char fragmentShader[] = \
        " void main()""\n"
        " { ""\n"
        "    occFragColor = vec4(0.0, 0.0, 1.0, 1.0);""\n"
        " }";


    gp_Pnt2d p0(0.0,0.0);
    gp_Pnt2d p1(20.0,0.0);

    Handle(Geom2d_Line) line = GCE2d_MakeLine(p0, p1);
    Handle(Geom2d_TrimmedCurve) lineTrim = new Geom2d_TrimmedCurve(line, 0.0, p0.Distance(p1));

    TopoDS_Edge edge = BRepBuilderAPI_MakeEdge2d(lineTrim);
    Handle(AIS_Shape) edgeShape = new AIS_Shape(edge);
   
    Handle(Graphic3d_ShaderObject) vs_object = Graphic3d_ShaderObject::CreateFromSource(Graphic3d_TOS_VERTEX, TCollection_AsciiString(vertexShader) );
    Handle(Graphic3d_ShaderObject) fs_object = Graphic3d_ShaderObject::CreateFromSource(Graphic3d_TOS_FRAGMENT, TCollection_AsciiString(fragmentShader) );

    Handle(Graphic3d_ShaderProgram) shaderProg = new Graphic3d_ShaderProgram();

    shaderProg->AttachShader(vs_object);
    shaderProg->AttachShader(fs_object);

    edgeShape->Attributes()->SetShaderProgram(shaderProg, Graphic3d_ASPECT_LINE, true);
    edgeShape->SynchronizeAspects();

    Context()->Display(edgeShape, false);
TagsNo tags attached.
Test case numberNot required

Activities

git

2017-08-22 10:25

administrator   ~0069731

Branch CR29031 has been created by kgv.

SHA-1: 8cd773a786a9b2a9c55f532ecc194488bc586fdc


Detailed log of new commits:

Author: kgv
Date: Tue Aug 22 10:23:41 2017 +0300

    0029031: Visualization - Prs3d_Drawer::SetShaderProgram() has no effect
    
    Prs3d_Drawer::SetShaderProgram() now takes into account HasOwn*** flags.

san

2017-08-22 12:08

developer   ~0069737

Branch CR29031 reviewed without remarks, ready for testing.

kgv

2017-08-22 12:15

developer   ~0069738

Started job:
http://jenkins-test-10.nnov.opencascade.com/view/CR29031-master-KGV

bugmaster

2017-08-24 11:43

administrator   ~0069820

Combination -
OCCT branch : CR29031 : SHA-1: 8cd773a786a9b2a9c55f532ecc194488bc586fdc
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:

OCCT :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

Products :
Linux: 5 (5 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:

Windows:
OCCT
Total CPU difference: 17330.010689098726 / 17295.75286949859 [+0.20%]
Producst
Total CPU difference: 7688.758886599963 / 7720.302288799964 [-0.41%]

Linux:
OCCT
Total CPU difference: 19451.89000000023 / 19456.560000000376 [-0.02%]
Products
Total CPU difference: 7703.40000000009 / 7725.120000000072 [-0.28%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2017-08-25 16:13

administrator   ~0069914

Branch CR29031 has been deleted by kgv.

SHA-1: 8cd773a786a9b2a9c55f532ecc194488bc586fdc

Related Changesets

occt: master 6ca8b614

2017-08-22 07:23:41

kgv


Committer: bugmaster Details Diff
0029031: Visualization - Prs3d_Drawer::SetShaderProgram() has no effect

Prs3d_Drawer::SetShaderProgram() now takes into account HasOwn*** flags.
Affected Issues
0029031
mod - src/Prs3d/Prs3d_Drawer.cxx Diff File

Issue History

Date Modified Username Field Change
2017-08-22 10:22 kgv New Issue
2017-08-22 10:22 kgv Assigned To => kgv
2017-08-22 10:25 git Note Added: 0069731
2017-08-22 11:59 kgv Product Version 7.2.0 => 7.1.0
2017-08-22 12:07 san Status new => resolved
2017-08-22 12:08 san Note Added: 0069737
2017-08-22 12:08 san Assigned To kgv => bugmaster
2017-08-22 12:08 san Status resolved => reviewed
2017-08-22 12:15 kgv Note Added: 0069738
2017-08-24 11:30 bugmaster Test case number => Not required
2017-08-24 11:43 bugmaster Note Added: 0069820
2017-08-24 11:43 bugmaster Status reviewed => tested
2017-08-25 15:02 bugmaster Changeset attached => occt master 6ca8b614
2017-08-25 15:02 bugmaster Status tested => verified
2017-08-25 15:02 bugmaster Resolution open => fixed
2017-08-25 16:13 git Note Added: 0069914
2017-09-29 16:17 aiv Fixed in Version => 7.2.0
2017-09-29 16:29 aiv Status verified => closed