Re: Help with VAOs

Chris Barker <[email protected]> Tue, 27 Jan 2015 13:39:02 -0800
Newsgroups gmane.comp.python.opengl.user
Message-ID <CALGmxELWFsDZcQYTaQqsQVdFx+n+vmcWrvzgmhfUojn53U=72A@mail.gmail.com>
--===============7143984796856940688==
Content-Type: multipart/alternative; boundary=047d7bfea61abf43ad050da9175a

--047d7bfea61abf43ad050da9175a
Content-Type: text/plain; charset=UTF-8

Sorry, I'm going to be really vague here, as it's been a while.

glBegin()
glVertex(...)
[...]
glEnd()

is the "old" way, and you are right, you really  don't want to do that.

The "new" way is all the shader magic - it may be time to bite the bullet
and learn that.

But the semi-new way is to use Vertex Buffer OBjects (VBOs) to efficiently
store your vertices on the Card. A little googling should get you started.

-CHB



On Tue, Jan 27, 2015 at 12:36 PM, Johannes Bauer <[email protected]>
wrote:

> Hello list,
>
> I'm trying to store objects (currently only vertices) on the graphics
> card so that I can avoid lots of:
>
> glBegin()
> glVertex(...)
> [...]
> glEnd()
>
> I've tried lots and lots of code now (none of which fully did what I
> wanted) and really am losing my mind soon :-( I could adapt this to work
> with my code:
>
> https://gist.github.com/MorganBorman/4243336
>
> And it does work, but when integrated in my 3D environment I noticed
> that the drawn objects are not rendered perspectively, but just a flat
> object.
>
> I'm looking for the easiest way to dump a bunch of vertices onto the
> graphics card and later reference those vertices to draw some object and
> have it render as if I had used glBegin(), glVertex(), glEnd(). Is this
> possible at all? Which approach should I look into?
>
> In general I've seen two different approaches, one that involes (usually
> super-primitive) shaders, others do not. I do not see why I would need a
> custom-shader for this task, is this really necessary?
>
> My goal ultimately is to store surfaces (i.e. vertices, their normals,
> their texture UV coordinates) on the graphics card.
>
> Any help is greatly appreciated,
> Johannes
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> PyOpenGL Homepage
> http://pyopengl.sourceforge.net
> _______________________________________________
> PyOpenGL-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyopengl-users
>



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

--047d7bfea61abf43ad050da9175a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Sorry, I&#39;m going to be really vague here, as it&#39;s =
been a while.<div><br></div><div><span style=3D"font-size:12.8000001907349p=
x">glBegin()</span><br style=3D"font-size:12.8000001907349px"><span style=
=3D"font-size:12.8000001907349px">glVertex(...)</span><br style=3D"font-siz=
e:12.8000001907349px"><span style=3D"font-size:12.8000001907349px">[...]</s=
pan><br style=3D"font-size:12.8000001907349px"><span style=3D"font-size:12.=
8000001907349px">glEnd()</span><br></div><div><span style=3D"font-size:12.8=
000001907349px"><br></span></div><div><span style=3D"font-size:12.800000190=
7349px">is the &quot;old&quot; way, and you are right, you really =C2=A0don=
&#39;t want to do that.</span></div><div><span style=3D"font-size:12.800000=
1907349px"><br></span></div><div><span style=3D"font-size:12.8000001907349p=
x">The &quot;new&quot; way is all the shader magic - it may be time to bite=
 the bullet and learn that.</span></div><div><span style=3D"font-size:12.80=
00001907349px"><br></span></div><div><span style=3D"font-size:12.8000001907=
349px">But the semi-new way is to use Vertex Buffer OBjects (VBOs) to effic=
iently store your vertices on the Card. A=C2=A0little=C2=A0googling should =
get you=C2=A0started.</span></div><div><span style=3D"font-size:12.80000019=
07349px"><br></span></div><div><span style=3D"font-size:12.8000001907349px"=
>-CHB</span></div><div><span style=3D"font-size:12.8000001907349px"><br></s=
pan></div><div><span style=3D"font-size:12.8000001907349px"><br></span></di=
v></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, J=
an 27, 2015 at 12:36 PM, Johannes Bauer <span dir=3D"ltr">&lt;<a href=3D"ma=
ilto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</=
span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex">Hello list,<br>
<br>
I&#39;m trying to store objects (currently only vertices) on the graphics<b=
r>
card so that I can avoid lots of:<br>
<br>
glBegin()<br>
glVertex(...)<br>
[...]<br>
glEnd()<br>
<br>
I&#39;ve tried lots and lots of code now (none of which fully did what I<br=
>
wanted) and really am losing my mind soon :-( I could adapt this to work<br=
>
with my code:<br>
<br>
<a href=3D"https://gist.github.com/MorganBorman/4243336" target=3D"_blank">=
https://gist.github.com/MorganBorman/4243336</a><br>
<br>
And it does work, but when integrated in my 3D environment I noticed<br>
that the drawn objects are not rendered perspectively, but just a flat<br>
object.<br>
<br>
I&#39;m looking for the easiest way to dump a bunch of vertices onto the<br=
>
graphics card and later reference those vertices to draw some object and<br=
>
have it render as if I had used glBegin(), glVertex(), glEnd(). Is this<br>
possible at all? Which approach should I look into?<br>
<br>
In general I&#39;ve seen two different approaches, one that involes (usuall=
y<br>
super-primitive) shaders, others do not. I do not see why I would need a<br=
>
custom-shader for this task, is this really necessary?<br>
<br>
My goal ultimately is to store surfaces (i.e. vertices, their normals,<br>
their texture UV coordinates) on the graphics card.<br>
<br>
Any help is greatly appreciated,<br>
Johannes<br>
<br>
---------------------------------------------------------------------------=
---<br>
Dive into the World of Parallel Programming. The Go Parallel Website,<br>
sponsored by Intel and developed in partnership with Slashdot Media, is you=
r<br>
hub for all things parallel software development, from weekly thought<br>
leadership blogs to news, videos, case studies, tutorials and more. Take a<=
br>
look and join the conversation now. <a href=3D"http://goparallel.sourceforg=
e.net/" target=3D"_blank">http://goparallel.sourceforge.net/</a><br>
_______________________________________________<br>
PyOpenGL Homepage<br>
<a href=3D"http://pyopengl.sourceforge.net" target=3D"_blank">http://pyopen=
gl.sourceforge.net</a><br>
_______________________________________________<br>
PyOpenGL-Users mailing list<br>
<a href=3D"mailto:[email protected]">PyOpenGL-Users@list=
s.sourceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/pyopengl-users" tar=
get=3D"_blank">https://lists.sourceforge.net/lists/listinfo/pyopengl-users<=
/a><br>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>=
Emergency Response Division<br>NOAA/NOS/OR&amp;R =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0(206) 526-6959=C2=A0=C2=A0 voice<br>7600 Sand Point Way NE=
 =C2=A0=C2=A0(206) 526-6329=C2=A0=C2=A0 fax<br>Seattle, WA =C2=A098115 =C2=
=A0 =C2=A0 =C2=A0=C2=A0(206) 526-6317=C2=A0=C2=A0 main reception<br><br><a =
href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
ov</a></div>
</div>

--047d7bfea61abf43ad050da9175a--


--===============7143984796856940688==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
--===============7143984796856940688==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users

--===============7143984796856940688==--