<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 class="gmail_extra"><br clear="all"><div><div dir="ltr">
<b>Joachim Pouderoux</b><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="1"><i>PhD, Technical Expert</i></font><br><b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br>
</blockquote>
</div></div>
<br><br><div class="gmail_quote">2014-07-18 11:03 GMT+02:00 carlinhos <span dir="ltr"><<a href="mailto:carlinhosmp87@gmail.com" target="_blank">carlinhosmp87@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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" 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 class=""><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 class=""><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 class=""><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">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 class="im HOEnZb">
<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" target="_blank">Re: GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1)</a><br></div>
<div class="HOEnZb"><div class="h5">
Sent from the <a href="http://vtk.1045678.n5.nabble.com/VTK-Dev-f1251487.html" target="_blank">VTK - Dev mailing list archive</a> at Nabble.com.<br></div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br></div>