<div dir="ltr">Joachim,<div><br></div><div>Thank you so much for the explanation, I tried something similar but building the shaders instead of not doing it (if I remember well). </div><div>Tomorrow i will try it and I will tell you the results!! </div>
<div><br></div><div>Carlos.<br><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-29 15:14 GMT+02:00 Joachim Pouderoux [via VTK] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=5728009&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span>:<br>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">

        <div dir="ltr"><div><div><div><div><div><div>Carlos<br><br>Ok actually I was wrong. My patch works but it is not how this is supposed to happen.<br></div>Basically, VTK will merge 2 different shader source code to define each type of shader (vertex, fragment etc.).<br>


</div>A first source will come from the shader code that can be attached to the renderer shaders.<br></div>If it not exist, the default is a main function that will call propFuncVS()/propFuncFS() etc - depending the shader type.<br>


</div>The second source will come from the shader code that can be attached to the actor's property.<br></div>If it not exist, the default behaviour is to define that propFuncVS/FS functions.<br>Both source codes will be appended before being compiled by the openGlProperty.<br>


<br>So basically if you do not define a renderer shader program, you simply have to provide a shader codes to your property that defines propFuncVS/FS functions instead of usual main() functions.<br>Also do not build your shader program (program->Build()) in your code as it will fail because the main() functions are not provided. Remember they will be added later automatically before compilation by OpenGLProperty.<br>


<br></div><div>Hope it is clear and it helps!<br><br></div>Best,<br><div><br><br></div></div></div><div class="gmail_extra"><div class=""><br clear="all"><div><div dir="ltr"><b>Joachim Pouderoux</b><br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #cccccc;padding:0 1em">


<font size="1"><i>PhD, Technical Expert</i></font><br><b><font size="1"><a href="http://www.kitware.fr" rel="nofollow" link="external" target="_blank">Kitware SAS</a></font></b><br></blockquote>
</div></div>
<br><br></div><div class="gmail_quote">2014-07-29 14:55 GMT+02:00 Joachim Pouderoux <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5728004&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>></span>:<br>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote"><div class="">

<div dir="ltr"><div>Actually it seems like there is a bug in vtkOpenGLProperty.cxx that I might have fixed. I will make a patch soon.<br></div>In the meanwhile try to change those lines:<br><pre style="font-family:Consolas;color:gainsboro;background:none repeat scroll 0% 0% rgb(30,30,30)">

        <span style="color:rgb(200,200,200)">needDefaultMainVS</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(180,180,180)">!</span><span style="color:rgb(200,200,200)">progHasVertex</span>
          <span style="color:rgb(180,180,180)">&&</span> <span style="color:rgb(180,180,180)"></span><span style="color:rgb(200,200,200)">propProg</span><span style="color:rgb(180,180,180)">-></span><span style="color:rgb(200,200,200)">HasVertexShaders</span><span style="color:rgb(180,180,180)">();</span>
        <span style="color:rgb(200,200,200)">needDefaultMainFS</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(180,180,180)">!</span><span style="color:rgb(200,200,200)">progHasFragment</span>
          <span style="color:rgb(180,180,180)">&&</span> <span style="color:rgb(180,180,180)"></span><span style="color:rgb(200,200,200)">propProg</span><span style="color:rgb(180,180,180)">-></span><span style="color:rgb(200,200,200)">HasFragmentShaders</span><span style="color:rgb(180,180,180)">();</span>
</pre>by<br><pre style="font-family:Consolas;color:gainsboro;background:none repeat scroll 0% 0% rgb(30,30,30)">        <span style="color:rgb(200,200,200)">needDefaultMainVS</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(180,180,180)">!</span><span style="color:rgb(200,200,200)">progHasVertex</span>
          <span style="color:rgb(180,180,180)">&&</span> <span style="color:rgb(180,180,180)">!</span><span style="color:rgb(200,200,200)">propProg</span><span style="color:rgb(180,180,180)">-></span><span style="color:rgb(200,200,200)">HasVertexShaders</span><span style="color:rgb(180,180,180)">();</span>
        <span style="color:rgb(200,200,200)">needDefaultMainFS</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(180,180,180)">!</span><span style="color:rgb(200,200,200)">progHasFragment</span>
          <span style="color:rgb(180,180,180)">&&</span> <span style="color:rgb(180,180,180)">!</span><span style="color:rgb(200,200,200)">propProg</span><span style="color:rgb(180,180,180)">-></span><span style="color:rgb(200,200,200)">HasFragmentShaders</span><span style="color:rgb(180,180,180)">();</span>
</pre>With that fixed, the steps you defined should now work as no second main() will be added to both shader code.<br><div><br><div><div>Joachim<br></div></div></div></div></div><div class="gmail_extra"><div class=""><br clear="all">
<div><div dir="ltr">


<b>Joachim Pouderoux</b><br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #cccccc;padding:0 1em"><font size="1"><i>PhD, Technical Expert</i></font><br><b><font size="1"><a href="http://www.kitware.fr" rel="nofollow" link="external" target="_blank">Kitware SAS</a></font></b><br>



</blockquote>
</div></div>
<br><br></div><div class="gmail_quote">2014-07-18 11:03 GMT+02:00 carlinhos <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5728004&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>></span>:<div>
<div class="h5"><br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote">

<div><div>
<div dir="ltr">Hello Xiaoming,<div><br></div><div>I created a new vtkOpenGLProperty and set it to the actor, anyways i tried to cast the vtkProperty obtained by the a <span style="font-family:arial,sans-serif;font-size:13px">vtkActor::GetProperty(), because vtkProperty is an abstract class. I tried so many things to make it work but i didn't manage to do it. Also i tried to use vtkOpenGLActors instead of vtkActors but it also didn't work.</span></div>




<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div>Carlos.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-18 9:46 GMT+02:00 xiaoming [via VTK] <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5727905&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>></span>:<br>




<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote">

        i'm sorry but i see that vtkActor::GetProperty() returns a pointer to the vtkProperty not vtkOpenGLProperty,which has a member of SetPropProgram,i 'm just confused with the 7th step,would you bother to tell me sth about that ,thanks in advance.
<br>Quote:
<br><div><div><  7- Put ShadingOn to the property and SetPropProgram with the
<br>vtkShaderProgram2 build before (The vtkShaderProgram on debug has only the
<br>2 shaders I put in).>
<br><br>

        
        
        
        <br>
        <br>
        </div></div><hr color="#cccccc" noshade size="1">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><div><div>
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </div></div><a href="http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5727903.html" rel="nofollow" link="external" target="_blank">http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5727903.html</a>
        </div><div><div><div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1), <a rel="nofollow" link="external" target="_top">click here</a>.<br>

                <a href="http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" link="external" target="_blank">NAML</a>
        </div></div></div></div></blockquote></div><br></div><div>


        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5727905.html" rel="nofollow" link="external" target="_blank">Re: GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1)</a><br>
</div>


<div><div>
Sent from the <a href="http://vtk.1045678.n5.nabble.com/VTK-Dev-f1251487.html" rel="nofollow" link="external" target="_blank">VTK - Dev mailing list archive</a> at Nabble.com.<br></div></div><br></div></div><div>_______________________________________________<br>



Powered by <a href="http://www.kitware.com" rel="nofollow" link="external" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="nofollow" link="external" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="nofollow" link="external" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
<br></div></blockquote></div></div></div><br></div>
</blockquote></div><br></div><div><div class="h5">
<br>_______________________________________________
<br>Powered by <a href="http://www.kitware.com" target="_blank" rel="nofollow" link="external">www.kitware.com</a>
<br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="nofollow" link="external" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>
Follow this link to subscribe/unsubscribe:
<br><a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="nofollow" link="external" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br><br>

        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        </div></div><div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><div><div class="h5">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </div></div><a href="http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5728004.html" target="_blank" rel="nofollow" link="external">http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5728004.html</a>
        </div><div class="HOEnZb"><div class="h5">
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1), <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>

                <a href="http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></div></div></blockquote></div><br></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5728009.html">Re: GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1)</a><br/>
Sent from the <a href="http://vtk.1045678.n5.nabble.com/VTK-Dev-f1251487.html">VTK - Dev mailing list archive</a> at Nabble.com.<br/>