The one thing I'm trying to do regarding shaders is try to make a chemical rocket engine shader. This requires two things: making the shape of the effect grow as it gets farther from the source, which I have done; and making it get less bright as it gets farther from the source, which I cannot figure out. My math skills are not good enough for this :)
The top image is what I have currently, the bottom image is a very approximate representation of what I want:
And this is my current shader code (from ship_engines.glsl):
Code
#ifdef TYPE_CHEMICAL // WIP float exhaustDensity(vec3 pos) { // Cylindric coordinates of the point float r2 = dot(pos.xy, pos.xy); float r = sqrt(r2); float l = 0.5 - 0.5 * pos.z;
// Noise to modulate exhaust core float Noise = 2.0; if (l > 0.25) // condition may speedup execution on some hardware { vec3 npos = pos; npos.xy *= 6.7; npos.z += EyePosTime.w; Noise -= noise(npos) * sqrt(max(l - 0.25, 0.0) * 1.333); }
And there are no contents of shader variables displayed.
Doc was talking about how to reload the shaders without reloading the program. As far as I know there isn't any specific information available to debugging shader code.
All forum users, please read this! My SE mods and addons Phenom II X6 1090T 3.2 GHz, 16 GB DDR3 RAM, GTX 970 3584 MB VRAM
Doc was talking about how to reload the shaders without reloading the program.
Yes, but what I need is a real debugger that can me display the contents of variables at runtime. There are plenty of such debugger, but I'd like to know if anyone can recommend a debugger, which is especially suitable for SpaceEngine.
I don't want it hollow, I just want it to get dimmer farther from the source, like a real rocket plume. As I said, my graphic showing what I want was very approximate.
Something like this:
All forum users, please read this! My SE mods and addons Phenom II X6 1090T 3.2 GHz, 16 GB DDR3 RAM, GTX 970 3584 MB VRAM
Edited by HarbingerDawn - Tuesday, 17.11.2015, 14:16
I know, but I'm afraid; the shader needs to be completely rewritten. This function returns only one value to the calling function: 'intensity'. This value determines the shape and color. I think there ought to be two values, one for the form and one for the color. But that exceeds currently still my skills with shaders.
I think by the way, it might be possible to write your own shaders scripts - for example, a function for an Einstein-Rosen Bridge - and with #Include to bind into the system. Then you can call these functions via an IF query. Moreover, I think, a separate thread for shader programming would make sense. wink
There I have speculated, it would be possible to write your own shaders and integrate them with #include "filename.glsl".
It is possible.
With Klud's astereroid and selena shaders I've tried it.
I have written a custom script for Klud's function 'float iqTurbulence (vec3 point, int octaves, float lacunarity, float gain)' From 'tg_common.glsl' needs to be removed this function, of course!
'kl_iqTurbulence.glsl'
Code
#include "tg_common.glsl"
#ifdef _FRAGMENT_
// "iqTurbulence" function by Inigo Quilez // http://www.iquilezles.org , http://www.decarpentier.nl/scape-procedural-basics
The line #include "tg_common.glsl" in Klud's scripts 'tg_asteroid_height.glsl' and 'tg_selena_height.glsl' must then be replaced by #include "kl_iqTurbulence.glsl".
And it works!
These are not the same images, which I have already published in Kluds thread, they are only of the same position.