PDA

View Full Version : A few script requests/ideas...


CHRiTTeR
08-20-2004, 04:59 PM
Hope u dont mind asking u guys coz I havent any programming skills of any kind (except 'input', 'print' and 'do loop' in basic :scream: ) and I thought it would be a cool idea to open a thread with some requests.

- Modifier: A tool to select all nonsmoothed edges and being able to chamfer/fillet them.

- Rendereffect: A true blooming effect: Using hdr data instead of just the white color.

- Rendereffect: Something like the previous request (blooming) but then for lensflares and highlights.

...more may follow



thanks,
-CHRiTTeR

Rens
08-20-2004, 05:08 PM
About the last two, check out the MR glare shader, it uses high range data.

- R

CHRiTTeR
08-20-2004, 05:13 PM
Does it work with scanline and/or Brazil too?

lechoo
08-21-2004, 10:08 AM
Check my DeFocus plugin, perheaps this is what you need.
http://pixelfactory.mchtr.pw.edu.pl/plug/defocus/defocus.html
At first I wrote it as script but it was working terribly slow, as plugin it is much faster.

Rens
08-21-2004, 12:22 PM
lechoo: A very nice plugin! Does it also work with HDR data?


CHRiTTeR: No I don't think glare will work with scanline or Brazil.


- Rendereffect: A true blooming effect: Using hdr data instead of just the white color. By this I assume you mean a 'glow' around bright parts of the image, yes?
You can also do this in Photoshop.
- Render out a HDR file of your image.
- Lower the exposure in HDRShop or another program that can handle HDR data. Only the brightest parts will be visible now.
- Bring it into photoshop and add that image as a layer on top of the LDR image.
- Blur the HDR layer.
- Set the blending mode to Screen.

- Rendereffect: Something like the previous request (blooming) but then for lensflares and highlights. For the highlights: see above. For the flares... do you mean the light streaks from bright spots or the 'ghosts' (the coloured circles), or both? The streaks can be done with the glare shader, or else there are several PS plugins. Those plugins will most likely also create the ghosts.

The ghosts are created because light bounces of the different lens surfaces in a camera lens and is pretty difficult to simulate in a realistic way.

- Modifier: A tool to select all nonsmoothed edges and being able to chamfer/fillet them.
Do you want this for Epoly or Emesh?

Here's something quick and dirty I just wrote for Epoly, see if you can use it. You'll have to chamfer the edges yourself afterwards.

obj = selection[1]
edge_border = #()

polyOp.setEdgeSelection obj #all
edge_array = getEdgeSelection obj as array

for edge in edge_array do
(
faces_array = polyOp.getFacesUsingEdge obj edge as array
one = polyOp.getFaceSmoothGroup obj faces_array[1]
two = polyOp.getFaceSmoothGroup obj faces_array[2]
if one != two then append edge_border edge
)

polyOp.setEdgeSelection obj edge_border
update obj

Hope this helps!

- Rens


P.S. the script selects alle the edges who are between two smoothing groups.

CHRiTTeR
08-21-2004, 01:35 PM
Wow Rens! :bounce:

Thanks alot! U da man!


By this I assume you mean a 'glow' around bright parts of the image, yes?
You can also do this in Photoshop.
- Render out a HDR file of your image.
- Lower the exposure in HDRShop or another program that can handle HDR data. Only the brightest parts will be visible now.
- Bring it into photoshop and add that image as a layer on top of the LDR image.
- Blur the HDR layer.
- Set the blending mode to Screen.Yes, that's what i meant.
Smart thinking there. Use HDRShop and keep tapping the '-' and save as...
But for animations it's a lot of work... that also a reason Why I'd like it straight out of the render.

For the highlights: see above. For the flares... do you mean the light streaks from bright spots or the 'ghosts' (the coloured circles), or both? The streaks can be done with the glare shader, or else there are several PS plugins. Those plugins will most likely also create the ghosts.

The ghosts are created because light bounces of the different lens surfaces in a camera lens and is pretty difficult to simulate in a realistic way.Yup I mean those streaks/stars/ghost.
For now I add them in Photoshop and it looks good enough, but again... for animation...

But maybe theres an (not to expensive) video-compositing package out there that can handle HDR-data?

Do you want this for Epoly or Emesh?

Here's something quick and dirty I just wrote for Epoly, see if you can use it. You'll have to chamfer the edges yourself afterwards.
Thanks! Thanks! Thanks! :thumbsup:
Gonna test it soon I get the chance...

Yes Epoly, may I become greedy and ask one for Emesh too? (though i almost never use emesh anymore). ::D

CHRiTTeR
08-22-2004, 10:47 AM
Check my DeFocus plugin, perheaps this is what you need.
http://pixelfactory.mchtr.pw.edu.pl/plug/defocus/defocus.html
At first I wrote it as script but it was working terribly slow, as plugin it is much faster.Hey lechoo, if u could adjust that plugin so it works with HDR-data, it would be really cool!

*Edit: Now I see its a defocussing/dof plugin... thats not really what I'm looking for. It must produce 'glares & flares' without the dof/defocus...

lechoo
08-22-2004, 12:58 PM
I'm working on HDRI creating\editing software and defocus will definitely be a part of it.

CHRiTTeR
08-22-2004, 01:52 PM
Sweet! Killercombo, hahaha :D

Wil it be free? :D
Hows the development going (stage?) and need some testers?

ZeBoxx
08-23-2004, 12:46 PM
Heya Rens,

Unfortunately Chritter failed to mention he was posting this to CGtalk as well, so we went through a bit of a duplicate effort.
As I wrote a similar script for editable_mesh/poly for him, I decided to check out yours as well, initially thinking mine would be obsolete.
However, I noticed two issues with your implementation that I hope you won't mind me pointing out - I am fully aware that it was a 'quick and dirty' script :)


faces_array = polyOp.getFacesUsingEdge obj edge as array
...
two = polyOp.getFaceSmoothGroup obj faces_array[2]
You assume here that there is a second face. This is not the case with 'open' edges - i.e. an edge that isn't shared between two faces/polys.


if one != two then append edge_border edge
I'm not sure if this is by design or not, but this will actually select an edge between faces which have smoothing groups 1&2 and 2&3 respectively as a result of the smoothGroup bitInteger being different. However, as both faces share smoothing group 2, the edge shouldn't be selected ?

You can find my implementation and a more thorough description at :
http://forums.splutterfish.com/viewtopic.php?p=20223#20223

There's plenty of room for improvement - one thing in particular that bugs me is that it's rather slow on editable meshes. Appears to be an issue with looking up smoothing groups in editable meshes (there's no meshOp struct function for this).

ZeBoxx
08-23-2004, 12:51 PM
- Rendereffect: A true blooming effect: Using hdr data instead of just the white color.
We implemented a work-around for 3ds max's render effects basing themselves off of the RGB channels. It's a bit dirty, and has limited functionality, but has saved a couple of studios a bit of effort - even if it's only in the preview stages.

See : http://www.pointzero.nl/sf/reffect_scale/

But yes, a render effect basic itself off of the HDR data would be better.
You could script this, you know ;) Would be piss-poor slow, however.
/me fears the thousands of #unclamped getPixel lookups

lechoo
08-23-2004, 02:44 PM
Sweet! Killercombo, hahaha :D

Wil it be free? :D
Hows the development going (stage?) and need some testers?I think it will be free. It is ~90% finished. But it is hard to say when it will be out, I'm busy with some other work for next two months. I'll try to finish everything by end of year.

CHRiTTeR
08-23-2004, 04:28 PM
Unfortunately Chritter failed to mention he was posting this to CGtalk as well, so we went through a bit of a duplicate effort.
Sorry 'bout that Boxx... I feel really dumb. U're right. Its would've been better if I had mentioned that. I'm glad u guys do this effort just because someone asks for it. I'll try to learn from my mistakes (also from the ones on the splutterfish forum).


We implemented a work-around for 3ds max's render effects basing themselves off of the RGB channels. It's a bit dirty, and has limited functionality, but has saved a couple of studios a bit of effort - even if it's only in the preview stages.
I'm going to check it out!
I really appreciate the effort u guys are doing.




I think it will be free. It is ~90% finished. But it is hard to say when it will be out, I'm busy with some other work for next two months. I'll try to finish everything by end of year
Nice! Take your time... :)

Rens
08-24-2004, 10:00 PM
Heya Rens,

Unfortunately Chritter failed to mention he was posting this to CGtalk as well, so we went through a bit of a duplicate effort.
As I wrote a similar script for editable_mesh/poly for him, I decided to check out yours as well, initially thinking mine would be obsolete.
However, I noticed two issues with your implementation that I hope you won't mind me pointing out - I am fully aware that it was a 'quick and dirty' script :) Hey ZeBoxx, how are things at Splutterfish?

Yea, some time before you posted here I came across the thread on the SF board, that was a bit odd to see.
I didn't spend more than 15 minutes on the script so it was bound to have errors; it was more intended to be a stepping stone for Chritter than a fully functional script.

Also feel free to point out as many errors as you'd like, I can only learn from them :)

You assume here that there is a second face. This is not the case with 'open' edges - i.e. an edge that isn't shared between two faces/polys. True, the script 'assumes' that all edges have two polygons.

I'm not sure if this is by design or not, but this will actually select an edge between faces which have smoothing groups 1&2 and 2&3 respectively as a result of the smoothGroup bitInteger being different. However, as both faces share smoothing group 2, the edge shouldn't be selected ?

You can find my implementation and a more thorough description at :
http://forums.splutterfish.com/viewtopic.php?p=20223#20223

There's plenty of room for improvement - one thing in particular that bugs me is that it's rather slow on editable meshes. Appears to be an issue with looking up smoothing groups in editable meshes (there's no meshOp struct function for this).[/font] It was a while ago when I've really taken a look at smoothing groups. When I was writing the script and testing the getFaceSmoothGroup method I somehow took up the idea that faces always have one smoothing group...
Anyway, yea that's a bad script error.

I just saw your script and it looks like a real script instead of a 15 minute speedsession :)
I'll check out how it works later tonight.

Thanks for taking the effort to also post this here and for taking the time to explain.

- Rens

ZeBoxx
08-29-2004, 12:23 PM
Heya Rens,

No problem - when I looked at the smoothingGroup stuff myself I initially looked at a function provided in the maxscript docs to get the actual smoothingGroups set - before I realized that BIT.and should work for the purposes.

SplutterFish things are, as far as I know, going pretty well - I've been out for about 5 days (800+ e-mails worth *groan* mostly spam) and a lot can happen in that time :)
Hopefully Scott will have posted his Siggraph summary :D

Happy rendering!

CGTalk Moderation
01-19-2006, 12:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.