GLSL Extrude Shader - Anyone?

bernardo's picture

Does anyone know of a GLSL Shader that does extrude?

like the image in attach.

thanks b.

PreviewAttachmentSize
extrude.jpg
extrude.jpg86.38 KB

dust's picture
Re: GLSL Extrude Shader - Anyone?

I just posted a displacment map last night. This displaces the vertices of your model just like extrusion. The only difference is you are not using the faces to extrude you are using a displacment map. The interesting is that displacment adds mote detail. Basically you would want to select the faces you want from a sphere and extrude them normally export you displacment map and add it to your qc project. Then import your non extruded model to qc put inside glsl and extrude. Just look I posted it a couple ours ago I'm on my iPod otherwise I would search for it. You might want to insert a uniform float so you can hook up a interpolator to the displacement or extrusion size.

cwright's picture
geometry shader, anyone?

You're adding faces by extruding (the face to connect the extruded region with the non-extruded sphere surface). That's not possible in GLSL without geometry shaders. So unless you're on Snow Leopard, you can't.

If you're on snow leopard, it's fairly trivial - use a texture as a displacement map, in the direction of each vertice's normal. You'll be emitting 5 quads for every input quad (the extra faces necessary for extrusion), which might harm performance.

dust's picture
Re: geometry shader, anyone?

where would your geometry shader go in the glsl path, the fragment side or the vertex side ?

i also posted my example to the qc list wondering about shadows not honoring the displaced faces don't know if its inherent to displacement or bug, but you might want to use a normal map to do a bump that might be proper i don't know im still figuring glsl out.

cwright's picture
Re: geometry shader, anyone?

dust wrote:
where would your geometry shader go in the glsl path, the fragment side or the vertex side ?

There's a separate shader, called a geometry shader. QC doesn't expose this (even in SL -- just checked), so I guess it's not possible. Yay more QC-SL braindamage... ("I'll take growing trends and anti-depressants for $1000, Alex")

Regarding the shadow stuff acting weird -- there are too many bugs with lighting to mention (see why we didn't take any serious swings at in for GLTools/kineme3D? it's actually a very tricky problem to do right, and apple couldn't even pull it off...)

dust's picture
Re: geometry shader, anyone?

ring

i think the answer alex is abilify and the side effect is akathasia or death.

lol

toneburst's picture
Re: geometry shader, anyone?

Damn, cwight, I thought we were going to get Geometry Shaders in QC 4 for a moment there (still waiting, predictably, for my pre-ordered Snow Leaopard install DVD, so I'm late the the party once again).

a|x

psonice's picture
Re: geometry shader, anyone?

Still waiting for mine too.

It was one whole pound cheaper at amazon, and I figured I could wait a few days longer for delivery. Then they emailed me to inform me that apple had delayed the release date (!) until today, so perhaps I'll get it tonight. They haven't answered my questions yet, but they seem to have knocked an extra pound off the bill. Oh well :)

Still, sounds like we're only missing lighting bugs, crashes, and a missing geometry shader panel. :)

gtoledo3's picture
Re: geometry shader, anyone?

HEY! There is "kinda multisampling"! Don't forget that :)

Today, I'm using GLSL and the lighting/shadow, and basically want to stab my computer... it's doing weird things where I have to flick the shadow on and off for changes to take... ugh.

cybero's picture
Re: geometry shader, anyone?

Quote:

(still waiting, predictably, for my pre-ordered Snow Leaopard install DVD, so I'm late the the party once again).

one good thing about being late to this sort of party is that you are able to glean from the published experiences and current discoveries and exploits of others, toneburst :-)

no substitute for an actual SL DVD, of course.

gtoledo3's picture
Re: geometry shader, anyone?

I sooooo want to run down a string of metaphorical substitutes for the SL experience right now :)

cwright's picture
Re: geometry shader, anyone?

Another problem I'm interested in: can you cast shadows on GLSL objects? I'm guessing not (the fragment shader needs to have the shadow map input for that to work), which -- if true -- makes the shadow thing even more of a gimmick (in the future, more and more objects will be rendered in shaders for better lighting and multitexturing, as well as other effects that immediate-mode stuff just can't do).

toneburst's picture
Re: geometry shader, anyone?

Yeah, at the moment, I'm more worried about trying to get my laptop running at all. I had a couple of kernel panics at the weekend while running Live, and it's basically trashed my HD, to the extent that the machine won't boot, and I can't even seem to reinstall the OS from the original media that came with it.

a|x

gtoledo3's picture
Re: geometry shader, anyone?

Yeah, I've been trying to do something with an object wrapped in a Gooch glsl and shadows all morning, and have just been running into all kinds of stuff....kinda sucks, because it's obvious something I want to do isn't going to work (it would have looked cool, I swear, lol....).

cybero's picture
Re: geometry shader, anyone?

Quote:

I had a couple of kernel panics at the weekend while running Live

Just thought after all this talk one way or another about Ableton Live, I ought to give it a spin. I have downloaded and installed Live Demo 7 LE and Live Demo Suite 8.

Both seem to be AOK, neither got the boot.

When you install SL, any Incompatible Software will go into a folder for such incompatibles at the root level of your drive called , imaginatively enough •~ , Incompatible Software.

Both items create no tail spin.

Don't know if your version is a compatible version, or not , but Ableton does not get listed in the 'Beautiful Stragglers' , page Apple's guide to SL Unsupported SW

cwright's picture
Re: geometry shader, anyone?

toneburst wrote:
... I can't even seem to reinstall the OS from the original media that came with it.

From my tech support days (i.e. now ;), that almost sounds like a dying-hardware issue -- have you had done hardware diagnostics on it?

cwright's picture
Re: geometry shader, anyone?

I've discovered some cool cheats they're doing.

Shadows are cast on GLSL Grids, but only where the grid originally is -- if vertex displacement changes the grid shape, the shadow is still cast, but it just sits there in space, looking stupid (i.e., have the vertex shader translate the vertices 1 unit on the z axis, and the shadow is still at z=0). Rippling grids have flat shadows.

Non-grid objects (spheres, cubes, teapots) don't get any shadow love at all if they're rendered in GLSL, so I'm guessing they're doing some kind of post processing algorithm to composite shadows manually, rather than normal "Shadow Mapping" techniques that produce shadow textures for the texture mapper or GLSL fragment shader to deal with.

so .. uh.. no yay. can look pretty, but quite a hack, and quite limited-use at that :/ In retrospect, I wouldn't feel so bad if we did special-casing GLSL stuff in Kineme3D now, since it would be just as quirky/wrong as this (I originally avoided this because such a method would end up like this)... bleh.

cybero's picture
Re: geometry shader, anyone?

Quote:

the machine won't boot, and I can't even seem to reinstall the OS from the original media that came with it

Have you tried Force booting holding down the Shift key once you've pushed the power button to power up your laptop?

Can you run the AHT?

Quote:

Note: Please be sure to disconnect any external devices, printers, hard drives, scanners, and so on (other than the Apple keyboard and mouse) from your Apple Computer before starting up to Apple Hardware test and running the Diagnostic.

To start up your computer in Apple Hardware Test:

If the computer is already on, insert the appropriate disc into the optical disc drive, then restart. If the computer is not on, turn it on and insert the disc as soon as possible after startup. Press and hold the "D" key before the gray startup screen appears. It takes a minute or so for Apple Hardware Test to start up and inspect your hardware configuration. While this is taking place, an icon appears on the screen:

When the process is complete, select your language and click the right arrow. If you aren't using a mouse, you can use the up and down arrows to select a language and then press the Return key. The Apple Hardware Test console appears. You can choose which sort of test or tests to perform: To perform all of the basic tests, click the Test button or press the "T" key or the Return key. To perform a more thorough diagnostic test, select the "Perform extended testing" checkbox under the Test button before you click the Test button.

from http://support.apple.com/kb/HT1509 for Intel Macs

Incidentally a lot of kernel panics can be created if you have any peripherals that have become 'Beautiful Stragglers' in Leo or SnowLeo.

The AHT will not check all your hardware, I think that video chip / card is one such item.

Been compiling an experimental driver by some chance?

leegrosbauer's picture
Re: geometry shader, anyone?

I did get mine on Sunday. I called around and found a single Future Shop in Montreal which had five copies remaining. You'll never believe this, but when I arrived at the store, a single salesman was hoarding those five copies tightly in one hand, only passing them out to those customers who specifically requested them.

Anyway ... I'm up, running and happy on 10.6. It's kind of weird and it's kind of buggy and I'm simply delighted with it. :-)

gtoledo3's picture
Re: geometry shader, anyone?

Wow, I'm sorry to hear that :/ Live can be an intense program, as far as really making a hard drive work. Digital audio workstation type of software can be rough in that regard period.

Were you doing anything in particular when it happened (kind of for my own reference... I use Live every so often). Running at 96k? My observation is that the high sample rate thing is very hard on a system in multiple regards.

I remember a time when hard drives just seemed to be so generally flaky for high track counts, that I really hated recording or mixing on most computers. I would get backup anxiety! I still do... I always have two backups.

bernardo's picture
Re: geometry shader, anyone?

ok cwright thanks alot for the information... the hole lots of information still can i apply geometry shaders in Leopard? ill start the work using these links:

http://appsrv.cse.cuhk.edu.hk/~ymxie/Geometry_Shader/ http://cirl.missouri.edu/gpu/glsl_lessons/glsl_geometry_shader/index.html

thanks everyone

toneburst's picture
Re: geometry shader, anyone?

Hi guys,

sorry for not replying for a while, and thanks for your sympathy and suggestions.

It looks like my problem was bad RAM, rather than HD corruption. Just ran AHT off the Application Install DVD, and it came up with a RAM error after only 7 seconds. I guess it was probably just a coincidence that Live happened to be running when the first panic happened.

My Snow Leopard order still hasn't arrived, so I'm debating whether it's worth attempting to reinstall 10.5.x. I'm also wondering if Apple will send me a new RAM chip under warranty (the machine is nearly new), or if I will have to send the machine back.

a|x

toneburst's picture
Re: geometry shader, anyone?

Live is great! I've been using it since v.1 (well, 1.5, actually, I think). It's definitely my favourite music-making application. I've always worked a lot with samples and loops, so it's the perfect fit for me really. I've also got a few hardware synths, and they also integrate nicely.

a|x

cwright's picture
Re: geometry shader, anyone?

bad ram? aww, that sucks. I had a bad stick in my dev machine for a week or two, and by the time I had it replaced it had corrupted the harddrive (system frameworks, of course) to the point where each mount would cause more and more problems. That was back under Tiger though, and I had most stuff backed up already (in preparation for Leopard).

They should send ram (contingent upon you sending in the bad ram?), since that's been user serviceable for quite a while in all apple laptops.

I don't know if SL will install happily if leopard isn't installed (or Tiger, though they don't endorse upgrading to 10.4 to 10.6 all at once, for "you didn't buy Leopard!" reasons), so depending on how hosed the leopard install is, a reinstall might be worth it just to ensure SL's installation goees smoothly. (note: I have never had SL not install properly, but I've not tried on fresh/blank machines)

toneburst's picture
Re: geometry shader, anyone?

cwright wrote:
...by the time I had it replaced it had corrupted the harddrive (system frameworks, of course) to the point where each mount would cause more and more problems.

I guess that's what must have happened in my case. After the initial kernel panic, the machine rebooted OK, but beachballed whenever I tried to start an application. After a couple of hold-power-button force shutdowns, it would no longer boot. I checked the HD with Disk Utility, then Drive Genius (the Repair utility seems to be just a front-end to fsck, like Disk Utility), and Diskwarrior, which was eventually able to force the disk into a state where I could at least get my documents off it over FireWire, though it still wouldn't boot.

Quote:
They should send ram (contingent upon you sending in the bad ram?), since that's been user serviceable for quite a while in all apple laptops.

Hopefully. I'm going to give my local Service Centre a call.

Quote:
I don't know if SL will install happily if leopard isn't installed (or Tiger, though they don't endorse upgrading to 10.4 to 10.6 all at once, for "you didn't buy Leopard!" reasons), so depending on how hosed the leopard install is, a reinstall might be worth it just to ensure SL's installation goees smoothly. (note: I have never had SL not install properly, but I've not tried on fresh/blank machines)

I've managed to install 10.5 again, with the offending RAM chip removed, happily. Now I have to try copy-back my 3rd-party apps and User folder, and see if I can get the machine back up-and-running as it was before. Fingers crossed.

a|x

cybero's picture
Re: geometry shader, anyone?

cwright wrote:

I don't know if SL will install happily if leopard isn't installed (or Tiger, though they don't endorse upgrading to 10.4 to 10.6 all at once, for "you didn't buy Leopard!" reasons), so depending on how hosed the leopard install is, a reinstall might be worth it just to ensure SL's installation goees smoothly. (note: I have never had SL not install properly, but I've not tried on fresh/blank machines)

Snow Leopard will install AOK on Leopard, that is the cheaper version of Snow Leopard.

Without Leopard installed it will not, according to Apple's site, install.

With Tiger installed, you actually need to buy the box set containing the 'fuller' SL that will correctly install on top of Tiger, and that will cost you a whole lot more.

So replace the RAM, install Leopard again and then use the disk you're still awaiting the arrival of - I'd shake Apple's tree a little, just to see if it has been dispatched at all. You can check that upon your Apple Store account.

toneburst's picture
Re: geometry shader, anyone?

cybero wrote:
Snow Leopard will install AOK on Leopard, that is the cheaper version of Snow Leopard.

Without Leopard installed it will not, according to Apple's site, install.

With Tiger installed, you actually need to buy the box set containing the 'fuller' SL that will correctly install on top of Tiger, and that will cost you a whole lot more.

Didn't realise that. I've actually got 2 SN discs on order, one full (edu.) price, one as a complimentary upgrade with my MBP. They still charge £7 for this though, which I think's a bit cheeky. Funnily enough, the cheaper one has an estimated delivery of next Monday, while the one I paid more for is scheduled to arrive today ('subject to change').

Quote:
So replace the RAM, install Leopard again and then use the disk you're still

Leopard installed fine with the offending RAM chip removed, so now just copying stuff back from my backup. Hopefully should be OK after that, bar the odd driver that will need to be reinstalled, and some possible registration/authorisation issues with 3rd-party plugins etc. (Native Instruments, maybe...).

a|x

cwright's picture
Re: geometry shader, anyone?

cybero wrote:
Snow Leopard will install AOK on Leopard, that is the cheaper version of Snow Leopard.

Definitely -- this is the "recommended" way to deal with it.

cybero wrote:
Without Leopard installed it will not, according to Apple's site, install.

That's what they say -- I don't know if it's true though.

cybero wrote:
With Tiger installed, you actually need to buy the box set containing the 'fuller' SL that will correctly install on top of Tiger, and that will cost you a whole lot more.

Not so - http://www.appleinsider.com/articles/09/08/27/apples_snow_leopard_disc_w...

Basically, it'll install just fine on Tiger too -- no parts of Leopard are "salvaged" when upgrading. The SL disc actually contains everything (as did the Leopard upgrade).

Unless by "fuller" you mean, "includes ilife and other software that you may or may not need". ;)

[disclaimer: this is disregarding all licenses and legalities, and is purely informational. I leave the question of ethics up to the reader.]

gtoledo3's picture
Re: geometry shader, anyone?

If that was true, then you couldn't make a bootable partition on a blank drive from the disc.

gtoledo3's picture
Re: geometry shader, anyone?

Jinx ;)

cybero's picture
Re: geometry shader, anyone?

Quote:

Basically, it'll install just fine on Tiger too -- no parts of Leopard are "salvaged" when upgrading. The SL disc actually contains everything (as did the Leopard upgrade).

Unless by "fuller" you mean, "includes ilife and other software that you may or may not need". ;)

Thanks for the heads up and redirection on that cwright :-)

toneburst's picture
Re: geometry shader, anyone?

Just got my SL disc!

Looks like I need to reinstall my Adobe apps, Final Cut Studio, the Dev Tools, and re-authorise a couple of applications. Haven't combed through all my 3rd-party plugins yet.

As soon as I've done that, I'll upgrade to SL.

Looks like getting the bad RAM replaced should under warranty should be relatively painless. Just spoke to my local Certifiable Service Centre, and I just have to take the faulty chip and the laptop (to prove ownership) over to them, and they should have a replacement chip to me within a couple of days, apparently.

a|x

psonice's picture
Re: geometry shader, anyone?

Lucky you, I'm still awaiting. Perhaps it'll be in my letterbox when I get home.

Then again, I can't install it anyway - got to get an iphone app finished and uploaded tonight :(

Anyone happen to have noticed if 16bit mode is now supported on nvidia in qc4? Or if there are more colour depth options? I'm writing an app that uses QC for some pretty heavy image processing, using >8bit cameras with high resolution, and doing things where >8bit colour really, really helps, and where performance has to be reasonable. Trying to juggle quality and speed, 16bit would be a real blessing!

Also, is core image + nvidia any better than it used to be?

cwright's picture
Re: geometry shader, anyone?

Haven't tested the bitdepth stuff any, but I know for sure that CoreImage on nvidia is worse (as in, it crashes all the time, for seemingly mundane operations). For me, it's so unusable that I'm not even excited to deal with it anymore (I'm back to just running my leopard dev machine, and doing occasional QC4 compatibility tests before getting burned again...)

psonice's picture
Re: geometry shader, anyone?

Ah, doesn't sound good :(

Hmm.. I'm going to have to experiment a lot (and pray 10.6.1 fixes a lot too!) by the sound of it. I was really hoping that a few 'basics' like 16bit modes and nvidia performance would be fixed in SL - for the app I'm writing, GCD would be a real bonus.

I'm writing a realtime image capture + processing app for astrophotography - the idea is basically: attach webcam/dvcam/etc to telescope, use QTKit to bring in the video stream and write it to disk, do some CPU based motion tracking/compensation, then pass the stabilised image through a QC setup where I've done lots of image correction and long exposure stuff in CI.

It's working well on leopard, but I've not written the tracking stuff and the stream writing part yet - both of those will need threading. GCD will make it a lot easier (and QTX might help too - QT7 for capture and QTX for output looks promising). But if CI is broken and 16bit isn't fixed, maybe I'll stick to 10.5 :(