<div dir="ltr">Thanks for your answer, i thought it wasn't the right way! <div><br></div><div>What do you mean when you say i have to load the shaders manually? The steps i'm doing are:<br><br>1- Create a vtkShaderProgram2</div>
<div>2- Create the vtkShader2 (VertexShader) and load it from the file with SetSourceCode.</div><div>3- Add my VertexShader to the vtkShaderProgram2 with "GetShaders()->AddItem()".</div><div>4- Repeat 2 and 3 with the FragmentShader.</div>
<div>5- Build the vtkShaderProgram and check the Build Status (to check if everything is ok).</div><div>6- Create a vtkActor and obtain his property(with GetProperty()).</div><div>7- Put ShadingOn to the property and SetPropProgram with the vtkShaderProgram2 build before (The vtkShaderProgram on debug has only the 2 shaders I put in).</div>
<div><br></div><div>When the actors are going to display into the screen, the warning window shows up and tells me that the main is defined twice (and shows me the Default shaders and mine).</div><div><br></div><div>Thanks again!!</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-08 18:25 GMT+02:00 Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.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"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">vtkOpenGLProperty::SetPropProgram is the right function but you have load your shaders manually now. I believe the error you are getting is because it is still trying to use the last shader code. </pre>

<pre style="white-space:pre-wrap;color:rgb(0,0,0)">- Aashish</pre></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Tue, Jul 8, 2014 at 3:15 AM, carlinhos <span dir="ltr"><<a href="mailto:carlinhosmp87@gmail.com" target="_blank">carlinhosmp87@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I'm using Vtk 6.1.0 and Qt 5.2.1 (C++) to develop my app.<br>
<br>
I have an assembly with different actors into a vtkRenderWindow.<br>
<br>
I load a shader with the class vtkShader2, and create the program with<br>
vtkShaderProgram2, all ok with this. After that, i wanted to attach the<br>
shader to the actors (i'm going to use different shaders, depending on the<br>
actors). The problem is i didn't find examples or documentation to do this<br>
and i'm not capable to use the classes for the shaders correctly.<br>
<br>
I searched into the class vtkOpenGLProperty to set the vtkShaderProgram2<br>
with the method "SetPropProgram" and i set the property of the actors with<br>
that one, but vtk shows me a warning window with a conflict between the<br>
default shaders and mine (total 4 shaders, 2 vertex and 2 fragment).<br>
<br>
Can someone help me? Thanks in advance!!<br>
<br>
<br>
<br>
--<br>
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-tp5727788.html" target="_blank">http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788.html</a><br>


Sent from the VTK - Dev mailing list archive at Nabble.com.<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>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr"><font face="trebuchet ms, sans-serif"><i>| Aashish Chaudhary <br>| Technical Leader         <br>
| Kitware Inc.            <br></i></font><div><i><font face="trebuchet ms, sans-serif">| </font><a href="http://www.kitware.com/company/team/chaudhary.html" target="_blank">http://www.kitware.com/company/team/chaudhary.html</a></i></div>

</div>
</font></span></div>
</blockquote></div><br></div>