MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029031Community[OCCT] OCCT:Visualizationpublic2017-08-22 10:222017-09-29 16:29
Reporterkgv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 7.1.0 
Target Version[OCCT] 7.2.0Fixed in Version[OCCT] 7.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
Attached Files

- Relationships

-  Notes
(0069731)
git (administrator)
2017-08-22 10:25

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.
(0069737)
san (developer)
2017-08-22 12:08

Branch CR29031 reviewed without remarks, ready for testing.
(0069738)
kgv (developer)
2017-08-22 12:15

Started job:
http://jenkins-test-10.nnov.opencascade.com/view/CR29031-master-KGV [^]
(0069820)
bugmaster (administrator)
2017-08-24 11:43

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
(0069914)
git (administrator)
2017-08-25 16:13

Branch CR29031 has been deleted by kgv.

SHA-1: 8cd773a786a9b2a9c55f532ecc194488bc586fdc

- Related Changesets
occt: master 6ca8b614
Timestamp: 2017-08-22 07:23:41
Author: kgv
Committer: bugmaster
Details ] Diff ]
0029031: Visualization - Prs3d_Drawer::SetShaderProgram() has no effect

Prs3d_Drawer::SetShaderProgram() now takes into account HasOwn*** flags.
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 Relationship added child of 0027682
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 user533 Fixed in Version => 7.2.0
2017-09-29 16:29 user533 Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker