PDA

View Full Version : Pointer needed to sample GLSL code



iapx86
07-07-2011, 01:23 PM
Please advise on 3D modeling.
Project probably needs GLSL.
Needs interaction between
autonomous objects on server
and user I/O on client.

Use GLSL to construct a server-side line segment with a property list.
Ends are A and B where location of B is given as an XYZ vector from A.
Properties include RGBA, XYZ of A, and a delay factor in microseconds.
Properties include a unique ID.
Segment is implemented entirely on server side.
Client can set and get properties of a segment while it is active.
Client can select and deselect segment.
Client camera can rotate around segment.
Server does not move segment.
Client can change XYZ of segment A or B.
Delay is used when client changes segment color.
The color is changed after the delay.

I have some, but limited, experience with OpenGL,
mostly pushing vertices over the bus to the server.
I find no GLSL examples suitable to plagiarize.

Any help offered will be appreciated.
Best help is a link to code worthy of plagiarizing.

mobeen
07-07-2011, 04:51 PM
Sorry this is not a place where u can ask us to do your assignment/project for u. You can ask any question where u r stuck.

iapx86
07-07-2011, 06:05 PM
Please note, I did not ask for someone to code for me.
Just a pointer to example code showing how client can
interact with autonomous object created on server with GLSL.
Surely there are examples.

Alfonse Reinheart
07-07-2011, 06:54 PM
What kind of server and client are we talking about here? Are we talking about X-server and X-clients? The OpenGL client/server model? What?

iapx86
07-08-2011, 12:09 AM
I mean the OpenGL client/server model.

I hope OpenGL treats the computer as serial client
and graphics card as parallel server
and GLSL as a way to create autonomous objects on the server.

Goal:
Load GLSL objects into a 3D space on the graphics card.
GLSL objects interact independent of client.
Pyglet code gets/sets GLSL object properties.
GLSL objects change behavior when pyglet sets properties.

No vertex lists or copies of objects wanted on the client.
Just GLSL object handles and communication with objects.

Experience:
I know ortho/perspective/scale/events.
I have moved the camera around with quaternions.

To make 3D scenes I know about colors and vertices,
operated on one at a time or in lists
to be sent over the bus from the client to server.

I don't know how to setup server-side objects
that can be "instructed" from the client side
after they have become instanced and active.

I have spent considerable time looking through books
searching the web, and experimenting with code without success.
I saw hints that this was possible but no "hello world" example.

Wanted:
Is there a simple example showing how this is done?

Ilian Dinev
07-08-2011, 12:10 AM
If you google without the epic glorified terminology, you'll find tutorials galore.

Alfonse Reinheart
07-08-2011, 02:12 AM
and GLSL as a way to create autonomous objects on the server.

Do you know what GLSL is? It has nothing to do with creating "autonomous objects". GLSL is a shading language. In general, it does not create objects; it is used to transform objects.

You could find ways to package very simple objects in shaders, such that you just send a couple of vertex attributes and have the shader stack generate all the vertices you need. But it wouldn't work for anything much more complex than simple geometry objects like spheres, cones, etc. For anything real, you will need to have meshes, just like you did before shaders.

If you want to do something like this, you need OpenCL.

iapx86
07-08-2011, 05:06 AM
Thank you for your responses.
I agree with all in every particular.
I am creating many extremely simple objects:
just a lot of autonomous line segments
(see my first post in this group).

I have found all the tutorials
but have not succeeded in making
a single line segment using GLSL
that could be controlled from
the program that launched it.

I am not inclined to make objects having volume
like teacups and figures.
Just lines that can change length and direction
and of color requested from my python script.

Even better would be if the lines could
have active capabilities like changing color when
its neighbor in a chain of lines changes color.

On your advice, I will look at OpenCL again.
In the past I tried to install it on my machine
but this machine is not as friendly to
gpgpu programming as I would like.
Perhaps I need to buy a new one.

I will continue to hope that you might know
some code fragment that will show me
how to achieve the goal with OpenGL.

If my terminology is difficult, I apologize.
I write the way I think, and try hard to make it accessible.
But in the end, I'm stuck with how I write.