Sign in to follow this  
TechnoRobbo

TR's Cloud Control Plugin V 2.0 - Getting Real (8-9-2013)

Recommended Posts

TR's Cloud Control

Version 2.0

 

It's designed to look like clouds not smoke.

Uses the Alpha Channel so it can behave as on overlay.

 

Uses Selection to control Cloud Shape

(Make sure billows are smaller than selections)

 

2 Reseed Buttons for 65536 unique renderings

(Apply on image, not apply on empty layer )

 

Version 2.0 Includes:

 


Light/Shadow Control 

Form clouds with selection 

Detail Sharpness Control

Snazzy new video

 

 


Version 1.2 includes a Billow Sizeadjustment and a Color Picker

(Thanks to Ego for the suggestion)

 

 

 

 

Menu: Effects->Render

CloudsMenu.PNG?raw=1

 

 

 

Let's blow stuff up

CloudDemo1.png?raw=1

 

Let's blow stuff up 2

CloudDemo2.png?raw=1

 

 

music by TechnoRobbo

 

Instructions (old version) on Youtube Part 2: http://youtu.be/SkbfK-UcFz0

 

Instructions (old version) on Youtube Part 3: http://youtu.be/E3k-qCwrco0

 

 

Let's blow some more stuff up!!!!

CloudDemo3.png?raw=1

 

Faux Bokeh

CloudDemo4.png?raw=1

 

Genie

CloudDemo5.png?raw=1

 

 

 

Clouds2.png?raw=1

 

How it works:

Randomly overlays a series of gradient transparent ellipses (up to 10000).

Allowing you to adjust transparency thickness and intensity 

 

 

Toxic Skies 

Created with version 1.2

Toxic%20Skies.png?raw=1

 

 

The Code

[hide][/hide]

// Submenu: Render
// Name: TR's Cloud Control
// Title: TR's Clouds Control PlugIn - v2.0
// Author: TechnoRobbo
// URL: http://www.technorobbo.com

#region UICode
byte Amount1 = 0; // [255] Reseed Major
byte Amount2 = 0; // [255] Reseed Minor
int Amount3 = 2000; // [500,10000] Cloud Thickness
int Amount4 = 10; // [1,120] Intensity
double Amount5 = 0.1; // [0.01,1] Billow Size
double Amount6 = 0.1; // [0.1,1] Sharpness
bool Amount7 = true; // [0,1] Alpha Transparency
bool Amount8 = true; // [0,1] Constraint to Selection
ColorBgra Amount9 = ColorBgra.FromBgr(255,255,255); // Cloud Color Highlight
ColorBgra Amount10 = ColorBgra.FromBgr(0,0,0); // Cloud Color Base
Pair<double, double> Amount11 = Pair.Create( 0.0 , 0.0 ); // Light Source
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{
    
        Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
        dst.CopySurface( src,rect.Location,rect);

        
        Random rndm = new Random(Amount1 * 256 + Amount2);
        
        PdnRegion sreg = EnvironmentParameters.GetSelection(src.Bounds);
        double CenterX = ((selection.Right - selection.Left) / 2)+selection.Left;
        double CenterY= ((selection.Bottom - selection.Top) / 2)+selection.Top;
        int thickness = Amount3;
        int intensity = Amount4;
        double smallbillow =Math.Sqrt(CenterX*CenterX + CenterY*CenterY)/25;
        double largebillow =Math.Sqrt(CenterX*CenterX + CenterY*CenterY)/6;
        double billow =Amount5;
        float sharp =(float)Amount6;
        bool opaque = !Amount7;
        bool Constrain=Amount8;     
        ColorBgra cloudcolor2 = Amount9;
        ColorBgra cloudcolor = Amount10;
        float LiteX = (float)Amount11.First * .5f, LiteY = (float)Amount11.Second * .5f;

        if (opaque){
            //----------------------------------
            Graphics g1 = new RenderArgs(dst).Graphics;
            g1.Clip =new Region(rect);
            g1.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            //--------------------------------
            
            System.Drawing.SolidBrush BBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
            g1.FillRectangle(BBrush , new Rectangle(selection.Top, selection.Left,selection.Width,selection.Height));
            BBrush.Dispose();
            g1.Dispose();
        }
        
        for (int i = 0; i<thickness; i ++){
            //----------------------------------
            Graphics g = new RenderArgs(dst).Graphics;
            g.Clip =new Region(rect);
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            //--------------------------------
            float neoChroma =(float )i/(float )thickness;
          
            double wide = billow * largebillow +  smallbillow - smallbillow * billow;

            System.Drawing.Drawing2D.GraphicsPath gp =new System.Drawing.Drawing2D.GraphicsPath();
            
            //==============================================
            Rectangle gpr =new Rectangle();      
            int timeout = 0; 
        
            do{
                if (timeout ==3000){goto quit;}
                timeout++;
                gpr.X = (int)( selection.Left + rndm.NextDouble() * selection.Width);
                gpr.Y  = (int)(selection.Top + rndm.NextDouble() * selection.Height);
                gpr.Width = (int) wide;
                gpr.Height =(int) wide;
            
            }while ( Constrain && (!sreg.IsVisible(gpr.Left,gpr.Top) || !sreg.IsVisible(gpr.Right ,gpr.Bottom) 
                || !sreg.IsVisible(gpr.Right,gpr.Top) || !sreg.IsVisible(gpr.Left ,gpr.Bottom)));
            //==========================================
            gp.AddEllipse(gpr);
            
            System.Drawing.Drawing2D.PathGradientBrush pgb = new System.Drawing.Drawing2D.PathGradientBrush(gp);
  
            pgb.CenterColor = Color.FromArgb((int)(rndm.NextDouble()*intensity + 8 ),
                (int)((float)cloudcolor2.R * neoChroma + (float)cloudcolor.R - (float)cloudcolor.R * neoChroma) ,
                (int)((float)cloudcolor2.G * neoChroma + (float)cloudcolor.G - (float)cloudcolor.G * neoChroma),
                (int)((float)cloudcolor2.B * neoChroma + (float)cloudcolor.B - (float)cloudcolor.B * neoChroma));
            cloudcolor.A =0;
            
            Color[] colors = { Color.FromArgb(0,255,255,255)};
            pgb.SurroundColors = colors;
            pgb.FocusScales= new PointF(sharp,sharp);
            float newx = LiteX * neoChroma - LiteX + LiteX  * neoChroma;
            float newy = LiteY * neoChroma - LiteY + LiteY  * neoChroma;
            pgb.CenterPoint= new PointF(gpr.Width * newx + (gpr.Right-gpr.Left)/2 +gpr.Left , 
                gpr.Height * newy + (gpr.Bottom - gpr.Top)/2 + gpr.Top);
        
            g.FillEllipse(pgb ,gpr);
                
            pgb.Dispose();
            quit:
            gp.Dispose();
            g.Dispose();
        }
        ColorBgra CP = dst[0,0];
        dst[0,0] = CP;
        GC.Collect();
    
}
 

TRsCloudControl.zip

Edited by TechnoRobbo
  • Upvote 1

Share this post


Link to post
Share on other sites

Nice plugin!

 

Constructive critique:  I think that Cloud Thickness is too powerful.   Anything above 30% and you get almost 100% filled selection/layer.  I'd reset the scale so that the maximum is 6000 on your current scale, then adjust the scale so it reads 1 to 100 or 1 to 256 (rather than 1000 to 10000).  I'd also argue that Intensity is too intense - but not by the same margin.

 

Edit:  Why not use the Primary color as the cloud color?  Or add a colorwheel so the user can select the color.  I want to render pink clouds - not white :(

Share this post


Link to post
Share on other sites

A quick fiddle with the parameter ranges yields a much less severe effect.  And a nicer one IMHO

 

#region UICode
byte Amount1 = 0; // [255] Reseed Major
byte Amount2 = 0; // [255] Reseed Minor
int Amount3 = 30; // [1,100] Cloud Thickness
int Amount4 = 32; // [1,100] Intensity
bool Amount5 = true; // [0,1] Alpha Transparency
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{

    Random rndm = new Random(Amount1 * 256 + Amount2);
    Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
    double CenterX = ((selection.Right - selection.Left) / 2)+selection.Left;
    double CenterY= ((selection.Bottom - selection.Top) / 2)+selection.Top;
    int thickness = Amount3 * 50;
    int intensity = Amount4 * 66 / 100;
    bool opaque = !Amount5;
 

Example

 

yhsjjie-138.png

Share this post


Link to post
Share on other sites

EER

 

I like the color picker Idea.

 

The Cloud thickness settings depends on the resolution of the image, larger images, say 2048 wide or higher, benefit from more thickness where as an 800 pixel wide image appears to be over kill. Intensity also makes more sense with larger images.

 

Try your test again with 4096 X 3072 and I think it will all be clear. 

 

I'm gonna post my Lightning Plugin (TR's Tesla Coil) first then revisit the Cloud Control. The lightning plugin is chuck full of parametrics.

 

I will add the color picker I think that will be sweet. Thanks!!!!

Edited by TechnoRobbo

Share this post


Link to post
Share on other sites

Version 2.0 Uploaded 

 

  • Light/Shadow Control
  • Form clouds with selection 
  • Detail Sharpness Control
  • Snazzy new video

music by TechnoRobbo

 

 

 

I'll post some more uses for the plugin later  - Explosions, Faux Bokeh.

 

Then I'm gong on my vacation! (Holiday - for the more civilized half of the planet)

Edited by TechnoRobbo

Share this post


Link to post
Share on other sites

Check out the new samples created with TR's Cloud Control!!!!


 


Let's blow some more stuff up!!!!


CloudDemo3.png?raw=1


TR's Cloud Control , TR's Scatter and Paste Alpha


 


 


Faux Bokeh


CloudDemo4.png?raw=1


 


Ok, now I'm on vacation... see y'all in a week.


Edited by TechnoRobbo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this