Page 17 of 104

Posted: Fri Dec 05, 2008 3:09 pm
by Mel
Thanks! :) i'm still trying to figure out how to produce a nice glow effect without having to render everything twice. I mean, i could figure how to set up a split render, but then, how to mix the images so the effect was efficient, i just don't imagne how to do it. In fact, Blindside's Xeffects are pretty good. I'm trying to build a small, quick "Predator/ normal refracted water" effect.

Posted: Fri Dec 05, 2008 3:21 pm
by fmx
there was an article on Gamastura a while ago describing how to do glow-effects using the alpha-channel as a "glow-marker", maybe something you could look into ;)

Posted: Fri Dec 05, 2008 3:58 pm
by Mel
If you have the place, that is exactly something that would fit in what i'm looking for :)

Posted: Fri Dec 05, 2008 11:59 pm
by sudi
hey i made a nice glow shader effect.
Image[/img]

Posted: Sat Dec 06, 2008 12:01 am
by dlangdev
Mel: Those are very nice images rendered using XEffects. Keep it up, post more images.

Also, this might interest you. Calculating diffuse and specular the Valve's Source way...

http://developer.valvesoftware.com/wiki ... detree.jpg

http://developer.valvesoftware.com/wiki/Phong_materials

That's where I'm going.

Posted: Sat Dec 06, 2008 12:02 am
by fmx
googling for "gamasutra glow" would get you what you want, but i'll saved you 10 seconds, here's the link:
http://www.gamasutra.com/features/20040 ... es_pfv.htm

now that i look at it again, it doesn't look like they do it in a single-pass :oops:

but it still might be possible to make a shader use the alpha component to give a sort of "emissive-glow" directly in one pass though, but won't look as good.

or maybe if you could somehow let the postprocess RTTexture retain the alpha component when the glow-object gets rendered (and I think it does anyway) then you would simply handle the glowing/blurring in the post-processing shader

ofcourse, you do realise that sacrificing the alpha-component might not be something you want to do?
:P

EDIT
or just look into Sudi's glow shader ;)
so nice of him to point it out

Posted: Sat Dec 06, 2008 12:13 am
by sudi
My glow shader only needs the scene rendered once the rest is done by itself. But it doesn't use the alpha channel. its kinda releays on the fact that a scene is normaly lit by a light and that only glowing things are really bright. basicly it makes bright stuff glow.

Posted: Sat Dec 06, 2008 4:17 pm
by BlindSide
I recently whipped up an ocean shader:

Image

Image

More info on the blog.

Mel: It really doesn't hurt that bad doing another pass. If it is a problem I can provide you with a patch for MRT (Currently DX only, if you want OGL too you have to search for Nadro's one). Using the alpha is a hacky way to get around it, you pretty much forfeit transparency, and you're going to need another pass for depth info if you're going to do DOF/SSAO/etc anyway. (Infact why not hack your glow param into XEffect's depth pass? Use the 3rd or 4th channels since only the first 2 are needed for 16 bit depth)

Posted: Sat Dec 06, 2008 4:43 pm
by Mel
I'll see. In fact what i want is to render whatever needs glow "only once", so i'm not rendering the scenes twice with diferent shaders, if possible.

Your ocean shader looks nice too :) but i see the colour of the ocean very uniform. In fact, the ocean is not that blue. It ranges from a very dark green-blue when you see it perpendicularly to a clearer green-blue, when it is almost in the horizont. Also, the reflection is very useful, It adds details from the environment, where the ocean is located, and finally, the specular power in the ocean is very high. Maybe i try and do another ocean shader on my own :)

http://meshuggah.4fo.de/OceanScene.htm

Sudi, how did you do it?

Posted: Sat Dec 06, 2008 11:30 pm
by BlindSide
BlindSide wrote:If it is a problem I can provide you with a patch for MRT (Currently DX only, if you want OGL too you have to search for Nadro's one).

Posted: Sun Dec 07, 2008 3:24 am
by Virion
sorry blindside but at first i thought it was some kind of muddy ground or rock. maybe becuse the water looks too solid?

Posted: Sun Dec 07, 2008 5:01 am
by DeM0nFiRe
yeah, blindside I think you should tone down some of the 'noise' in the water. It makes the water look like plastic. And as Mel said you may want to check your color too.

Posted: Sun Dec 07, 2008 12:25 pm
by Mirror
demonfire the plasticity that you see in blindside's water is not because of overly sharp noise. it's mainly because of lack of refraction but that's not an issue.

blindside, very good vertices animation indeed :D
about sin() it truly is bad if used alone, but if you use it in combination with cos(), adding each other etc you get better results, not as good though as this perlin noise that you posted. it surely beats it to death :D
p.s. how dense the watermesh grid is ?

Posted: Sun Dec 07, 2008 1:20 pm
by xsocom
BlindSide, It looks very nice, do you use projected grid method? if so take a look at this, maybe give you some ideas.

http://graphics.cs.lth.se/theses/projec ... iddemo.zip

Posted: Sun Dec 07, 2008 2:11 pm
by DeM0nFiRe
Oh, yep mirror I see what you mean.

I also didn't mean the noise was too sharp, just that there was too much of it, which I still do, unless it's raining in this example. Since I see no rain or anything to cause irregular disturbances, there shouldn't be so much irregularity in the waves. If there's nothing to cause irregularities, waves in water are pretty regular.