@EmpirePhoenix said:
dont set glowcolor, use a glowmap you generate similar texture procedualy via a shader (see wiki for how to use glow in custom materials).
That's not a bad idea unless you have lots of surfaces to texture. That would double the workload. But yes, I agree it would work nicely when you don't have that many to do.
Well yes it would cpu wise, but since you usually only have like 1-2 suns at the same time this is probably not really eating that much performance away. (Also for the glowmap you could just use the rough version without all the more detailed noise levels)
The good thing is, every time a 4d texture is generated, it’s the same. Always. Unless you change parameters of course. The other thing is, it’s 3D and animated. Now, you could do without the animation I guess, but it wouldn’t look as good.
The only way I could see using this as a glowmap is if you were doing this CPU-side, fetch the texture in memory, apply a deformation to accommodate the shape it’ll be on, save it to a texture then pass it on to the shader as a glowmap.
I’m not sure I understand why replacing the object’s glow shader with your own that rendered a glow version of your procedural texture wouldn’t work. It’s glow.frag that renders the glow map for the object. You already have your own material so I’d think you could just swap the glow technique out with your own shaders.
@pspeed said:
I'm not sure I understand why replacing the object's glow shader with your own that rendered a glow version of your procedural texture wouldn't work. It's glow.frag that renders the glow map for the object. You already have your own material so I'd think you could just swap the glow technique out with your own shaders.
What?
I'm not saying to replace the shader. The glowmap is a texture. There's no texture to use in a procedural texture so the above would be a way to get a similar texture to use as a glowmap... Although if the generated texture is animated it might not look that good since the shades of the color would come and go but not the glowmap.
As far as using the glow pass in the texture generation shader it could work by using the passed color, but again, no glowmap (or colormap or whatever it's called). It comes back to the same.
I'm not saying to replace the shader. The glowmap is a texture. There's no texture to use in a procedural texture so the above would be a way to get a similar texture to use as a glowmap... Although if the generated texture is animated it might not look that good since the shades of the color would come and go but not the glowmap.
As far as using the glow pass in the texture generation shader it could work by using the passed color, but again, no glowmap (or colormap or whatever it's called). It comes back to the same.
I guess I misunderstood the thread by skimming.
I thought that there was a generated texture for the coloring and that one would want a similar generated "texture" for the "glow map".
Since the "GlowMap" texture2D object is just an artifact of the simple glow.frag, I couldn't see why you'd even want it. It will be pretty easy to render a "glow map" on the fly just like the regular shape was rendered in the normal pass. Then you'd have perfect synergy between glow map and diffuse texture. In fact, given the way the plasma looks you could probably just use the same .vert and .frag for the Technique Glow in the j3md and it would look fine. Or at least be a start for tweaking.
But I guess the thread is about something else. Sorry for the noise.
I think I need to look at how the glow technique works some more before I can comment but yes, that’s essentially what I was thinking might work. You do end up generating the texture twice though and I’m not sure how expensive that would be.
This is back on the back burner for now anyway but it should be fun to play with when I get to it.
Rendering the procedually map similar to the glowmap in the default glow was what I suggested from the beginning. And with cpu wise I meant, gpu power currently increase rapidly, while cpu (son one core alone) stays kind the same. As long as your additional work is on the gpu it’s not that bad then.(Like generating the glow map more or less twice one time for the glow and one time for diffuse.)
Doing it any other way, anyway all the ways I tested, rendered a texture with distortion around the equator in the case of my stars. If you’re only doing simple things like quads it should work with g_WorldViewMatrix * inPosition; Except for that, test different combinations.