GLSL wireframe shader HELP

HVP's picture

I've try some wireframe shader from: http://www.tommyhinks.com/ http://www2.imm.dtu.dk/~jab/Wireframe/

But I can't make it work properly...

Any one experienced with GLSL?

PreviewAttachmentSize
GLSL Wireframe.qtz13.71 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cybero's picture
Re: GLSL wireframe shader HELP

http://cgg-journal.com/2008-2/06/index.html#tth_sEc1.1

I can get the wireframe working outside of QC, but QC's stubborn adherence to its own support for GLSL 1.1 presently stymies me. I'm finding that often as such with were I'm wanting to go with GLSL , which is leaning more to compiling with headers than relying solely upon QC for achieving certain effects, which sadly, cannot be exploited in QC.

The thing about the shader code you've ported is that it only supports objects set to Replace, with Over, Add and Alpha Mode unavailable.

gtoledo3's picture
Re: GLSL wireframe shader HELP

I happen to have this lattice shader with texture input and some bias settings that I use to emulate wireframe. It's based on the apple developer example, with some extra stuff to adjust the fake wireframe, and to make it textured.

PreviewAttachmentSize
LatticeTexture_gt.qtz6.42 KB

cybero's picture
Re: GLSL wireframe shader HELP

Thanks for sharing that, gtoledo.

I have had lattice and a square frame glsl happening in QC, but not wireframe Polygon mode without the use of the GL Tools Polygon mode patch :-).

[On another note, it's truly sad that QC 4.5 has such problems with the video input patch. I think it could be to do with some failure for the system to negotiate the USB bus].

gtoledo3's picture
Re: GLSL wireframe shader HELP

There is no such thing as an actual "glsl wireframe shader", as far as I know. Maybe there's some novel shader call that I'm not aware of...I never cease to be amazed at some tricks available.

GL Polygon Mode is laid out here pretty well: http://www.opengl.org/sdk/docs/man/xhtml/glPolygonMode.xml

It boils down to this:

void glPolygonMode( GLenum face, GLenum mode);

Where, you make the glPolygon mode call, and you enumerate the face and the mode. When you look at the GL Tools Polygon mode patch, it's making this call and exposes most of the parameters that are available; one is able to control front and back faces independently, and you're able to make them one of three modes - fill, wire, or point.

The lattice shader, as is, isn't drawing lattice where the polygons actually are. It's a different thing, even though they both control the way the object's faces draw. In a lot of ways, the lattice shader route is pretty cool, because you can have the appearance of dense grid that would only be possible with very high poly count and polygon mode.

On another note, I don't use Lion often, but I don't remember it having big problems with the video patch on my particular machine (not that this says much - performance is so variable across machines)... I was using the built in iSight though. I'd try booting it in 32 bit mode and seeing if it makes any difference. Maybe using the kineme video patch if you have it? Does it connect, or just do weird stuff?

cybero's picture
Re: GLSL wireframe shader HELP

Thanks for the advice regarding gl_PolygonMode in GLSL code.

Yeah, I know lattice and square frame's are not the same as wireframe [of models / objects inside the shader]

A] Video patch - on iMac | Lion often fails to do more than turn on the camera, but it doesn't subsequently guarantee a video image. Looks like it is something to do with the USB bus[upon which the in built iSight is placed].

B] Video Tools - finds any FireWire connected cameras, USB is not supported, or if it is, then it is also falling foul of what I suspect is the same problem boggling QC in [A] above.

32 bit mode makes no difference on this camera problem, nor does it replicate for me outside of assets calling upon the QuartzComposer.framework with extension .qtz [thus far anyway, YMMV ]. Whacked TV ,for instance, gets immediate results out of the iSight camera - nil QuartzComposer.framework linkage.

At this rate , I might be making a QC only USB bus Video patch / plugin myself :-), either that or tackling just what is QC spitting it's dummy out about.

HVP's picture
Re: GLSL wireframe shader HELP

Thanks to all,

The GL Tools Polygon mode patch will do the trick for me.

HVP's picture
Re: GLSL wireframe shader HELP

What are you using to test the shader out of QC? Is there a free/open source tool to let me test the shader with more recent than GLSL 1.1 version?