pyrochild Posted June 6, 2007 Share Posted June 6, 2007 CMD, wanna share? ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
pyrochild Posted June 6, 2007 Share Posted June 6, 2007 CMD, wanna share? ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Crazy Man Dan Posted June 6, 2007 Share Posted June 6, 2007 I dunno... Like I said, it's a very small change. I didn't do much. :wink: I just kept the instantiation of the Primary Color and the first slider from the default CodeLab source, and set the variable to change what's added in the Random call. As such, I can't make it shorter, other than by selecting a shorter region, but I can make it longer to fill the whole area with gradating alpha goodness. int Amount1=1; //[1,500]Length int Amount2=0; //[0,50]Seed void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = selectionRegion.GetBoundsInt(); ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; Random rand = new Random(Amount2); ColorBgra CurrentPixel; for(int x = rect.Left; x < rect.Right; x++) { int length = rand.Next(selection.Height - 1) + Amount1; for (int y = rect.Top; y < rect.Bottom; y++) { CurrentPixel = PrimaryColor; CurrentPixel.A = Utility.ClampToByte(255 * (length - y) / length); dst[x,y] = CurrentPixel; } } } I also made a little 16px by 16px icon for it (), and built the DLL, calling it "Cascade". If there's anything grievously wrong with this code, please lemme know. I'm still learning this whole thing, after all. :wink: Edit: Changed to newest source I am not a mechanism, I am part of the resistance; I am an organism, an animal, a creature, I am a beast. ~ Becoming the Archetype Link to comment Share on other sites More sharing options...
Crazy Man Dan Posted June 6, 2007 Share Posted June 6, 2007 I dunno... Like I said, it's a very small change. I didn't do much. :wink: I just kept the instantiation of the Primary Color and the first slider from the default CodeLab source, and set the variable to change what's added in the Random call. As such, I can't make it shorter, other than by selecting a shorter region, but I can make it longer to fill the whole area with gradating alpha goodness. int Amount1=1; //[1,500]Length int Amount2=0; //[0,50]Seed void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = selectionRegion.GetBoundsInt(); ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; Random rand = new Random(Amount2); ColorBgra CurrentPixel; for(int x = rect.Left; x < rect.Right; x++) { int length = rand.Next(selection.Height - 1) + Amount1; for (int y = rect.Top; y < rect.Bottom; y++) { CurrentPixel = PrimaryColor; CurrentPixel.A = Utility.ClampToByte(255 * (length - y) / length); dst[x,y] = CurrentPixel; } } } I also made a little 16px by 16px icon for it (), and built the DLL, calling it "Cascade". If there's anything grievously wrong with this code, please lemme know. I'm still learning this whole thing, after all. :wink: Edit: Changed to newest source I am not a mechanism, I am part of the resistance; I am an organism, an animal, a creature, I am a beast. ~ Becoming the Archetype Link to comment Share on other sites More sharing options...
pyrochild Posted June 6, 2007 Share Posted June 6, 2007 errrr, can I use that icon for something I'm making? ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
pyrochild Posted June 6, 2007 Share Posted June 6, 2007 errrr, can I use that icon for something I'm making? ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Crazy Man Dan Posted June 6, 2007 Share Posted June 6, 2007 NO! MINE! He cannot has. Sure, go for it! As long as the something you're making is going to be awesome. :wink: I am not a mechanism, I am part of the resistance; I am an organism, an animal, a creature, I am a beast. ~ Becoming the Archetype Link to comment Share on other sites More sharing options...
Crazy Man Dan Posted June 6, 2007 Share Posted June 6, 2007 NO! MINE! He cannot has. Sure, go for it! As long as the something you're making is going to be awesome. :wink: I am not a mechanism, I am part of the resistance; I am an organism, an animal, a creature, I am a beast. ~ Becoming the Archetype Link to comment Share on other sites More sharing options...
pyrochild Posted June 6, 2007 Share Posted June 6, 2007 I think you will like.... oh, by the way CMD, my new avatar was made using basically your cascade script... just, a bit different. It was still based off of Enormator's code though. ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
pyrochild Posted June 6, 2007 Share Posted June 6, 2007 I think you will like.... oh, by the way CMD, my new avatar was made using basically your cascade script... just, a bit different. It was still based off of Enormator's code though. ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Share Posted June 6, 2007 I dunno... Like I said, it's a very small change. I didn't do much. :wink:I just kept the instantiation of the Primary Color and the first slider from the default CodeLab source, and set the variable to change what's added in the Random call. As such, I can't make it shorter, other than by selecting a shorter region, but I can make it longer to fill the whole area with gradating alpha goodness. int Amount1=1; //[1,500]Length void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = selectionRegion.GetBoundsInt(); ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; Random rand = new Random(0); // <=== (1) ColorBgra CurrentPixel; for(int x = rect.Left; x < rect.Right; x++) { int length = rand.Next(selection.Bottom - selection.Top -1) + Amount1; // <=== (2) for (int y = rect.Top; y < rect.Bottom; y++) { CurrentPixel = PrimaryColor; CurrentPixel.A = Utility.ClampToByte(255 * (length - y) / length); dst[x,y] = CurrentPixel; } } } If there's anything grievously wrong with this code, please lemme know. I'm still learning this whole thing, after all. :wink: 2 remarks: 1. Random(0) will always give the same value, all images should be similar. I suggest to use Amount2 [0,9999] Reseed Number. 2. selection.Bottom - selection.Top -1 will always give the same value : take it out the 'for' loop! My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
MadJik Posted June 6, 2007 Share Posted June 6, 2007 I dunno... Like I said, it's a very small change. I didn't do much. :wink:I just kept the instantiation of the Primary Color and the first slider from the default CodeLab source, and set the variable to change what's added in the Random call. As such, I can't make it shorter, other than by selecting a shorter region, but I can make it longer to fill the whole area with gradating alpha goodness. int Amount1=1; //[1,500]Length void Render(Surface dst, Surface src, Rectangle rect) { PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); Rectangle selection = selectionRegion.GetBoundsInt(); ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor; Random rand = new Random(0); // <=== (1) ColorBgra CurrentPixel; for(int x = rect.Left; x < rect.Right; x++) { int length = rand.Next(selection.Bottom - selection.Top -1) + Amount1; // <=== (2) for (int y = rect.Top; y < rect.Bottom; y++) { CurrentPixel = PrimaryColor; CurrentPixel.A = Utility.ClampToByte(255 * (length - y) / length); dst[x,y] = CurrentPixel; } } } If there's anything grievously wrong with this code, please lemme know. I'm still learning this whole thing, after all. :wink: 2 remarks: 1. Random(0) will always give the same value, all images should be similar. I suggest to use Amount2 [0,9999] Reseed Number. 2. selection.Bottom - selection.Top -1 will always give the same value : take it out the 'for' loop! My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Crazy Man Dan Posted June 6, 2007 Share Posted June 6, 2007 My apologies to Enormator for hijacking this thread. Please see response here. I am not a mechanism, I am part of the resistance; I am an organism, an animal, a creature, I am a beast. ~ Becoming the Archetype Link to comment Share on other sites More sharing options...
Crazy Man Dan Posted June 6, 2007 Share Posted June 6, 2007 My apologies to Enormator for hijacking this thread. Please see response here. I am not a mechanism, I am part of the resistance; I am an organism, an animal, a creature, I am a beast. ~ Becoming the Archetype Link to comment Share on other sites More sharing options...
pyrochild Posted June 6, 2007 Share Posted June 6, 2007 Just realized, rather than selection.Bottom - selection.Top, why not just use selection.Height? It's the same value... and makes the code easier to read. ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
pyrochild Posted June 6, 2007 Share Posted June 6, 2007 Just realized, rather than selection.Bottom - selection.Top, why not just use selection.Height? It's the same value... and makes the code easier to read. ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Enormator Posted June 12, 2007 Author Share Posted June 12, 2007 calm down everybody. This line effect is just the first step. Further ones will follow. But I don't tell you what I'm going to do because otherwise some one else may be faster than me. EDIT: And I noticed, that the lines were never repeating. I hust used the effect on a white background^^ :Link: website Link to comment Share on other sites More sharing options...
Enormator Posted June 12, 2007 Author Share Posted June 12, 2007 Can I start a different effect from Codelab? Something like Effects.Emboss(45) :Link: website Link to comment Share on other sites More sharing options...
pyrochild Posted June 12, 2007 Share Posted June 12, 2007 EmbossEffect embosseffect = new EmbossEffect(); EmbossEffectConfigToken token = new EmbossEffectConfigToken((double)45); embosseffect.Render(token, new RenderArgs(dst), new RenderArgs(src), selectionRegion); ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Enormator Posted June 12, 2007 Author Share Posted June 12, 2007 And if the effect isn't a standart effect? Let's say I want to do a feather. Can I use a dll in the effects folder? (I don't need to give args, default will work fine) :Link: website Link to comment Share on other sites More sharing options...
Enormator Posted June 18, 2007 Author Share Posted June 18, 2007 It's about time for a lense flare plugin. And I see that I... just can't do this. Sure the gradient things are no problem but these particles flowing from the center... I just can't do it yet. If some skilled progger reads this; My idea which I wasn't able to do: Make these random lines from top to bottom but fewer lines. Then add a rect to polar conversion. I made it to do fewer particles but when I rect2polared it, it looked like bloody potato. May someone more experienced do this. I'm sorry this is above my skills atm. :Link: website Link to comment Share on other sites More sharing options...
MadJik Posted June 18, 2007 Share Posted June 18, 2007 The way you describe it looks a bit strange to me. Could you make (by hand) a picture of what you want to do? Could you publish as it is the code you've done till now for that? My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Enormator Posted June 26, 2007 Author Share Posted June 26, 2007 Anyway my source seems to be lost. My HDD is nearly broken. And I can't even create by hand what I was aiming for. This image is what I was aiming for, just in white and alpha instead of red and black. It is taken from http://www.gamedev.net/reference/articles/article874.asp My idea was to make these lines (a bit thicker and fewer) and then rect2pol them. But when I did that by hand (rect2pol) it looked ugly. :Link: website Link to comment Share on other sites More sharing options...
MadJik Posted June 26, 2007 Share Posted June 26, 2007 Something I'm working on... My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
FireFly Posted June 26, 2007 Share Posted June 26, 2007 Anyway my source seems to be lost. My HDD is nearly broken. And I can't even create by hand what I was aiming for.This image is what I was aiming for, just in white and alpha instead of red and black. It is taken from http://www.gamedev.net/reference/articles/article874.asp My idea was to make these lines (a bit thicker and fewer) and then rect2pol them. But when I did that by hand (rect2pol) it looked ugly. I tried and came up with this: Radical gradient --> Dents --> Zoom Blur Deluxe --> Curves. The key in that is the dents. To make it look better I should have tried different settings but my first try was good enough I thought. EDIT: Maybe also using a smaller radical gradient could improve the flare. Link to comment Share on other sites More sharing options...
Recommended Posts