Streak Thunderstorm Posted June 14, 2012 Report Share Posted June 14, 2012 Day/night system test. A day and night cycle made in MMF2. Prototype for something coming later. Cycle 0 - 6 to change the time of day. Link to comment Share on other sites More sharing options...
Eminence Posted June 15, 2012 Report Share Posted June 15, 2012 1.) Create black box over screen. 2.) Set semi-transparency of box to that of relevant alterable value. 3.) Add "1" to alterable value every 'x' seconds, minutes, etc. 4.) Program certain events to only happen when "time" (alterable value) is between "x" and ""x". Boom, instant extra replayability to any game. Link to comment Share on other sites More sharing options...
BlazefireLP Posted June 15, 2012 Report Share Posted June 15, 2012 So basically your transparently blending images together? Looks nice though. Link to comment Share on other sites More sharing options...
Streak Thunderstorm Posted June 15, 2012 Author Report Share Posted June 15, 2012 No, I'm not. There's no box overlaying anything. The actual background is changing color. Link to comment Share on other sites More sharing options...
BlazefireLP Posted June 15, 2012 Report Share Posted June 15, 2012 Are you RGB shifting the colours? Edit: I mean HUE. Link to comment Share on other sites More sharing options...
TailsSena Posted June 15, 2012 Report Share Posted June 15, 2012 Can you compile this as a screensaver? I love it! Link to comment Share on other sites More sharing options...
Streak Thunderstorm Posted June 16, 2012 Author Report Share Posted June 16, 2012 Yes, I am actually RGB shifting the colors. Each channel, actually. It can apply to all layers beneath it to give a color bleed effect so that the sky seems to be effecting everything else's colors. Link to comment Share on other sites More sharing options...
DimensionWarped Posted June 16, 2012 Report Share Posted June 16, 2012 I personally feel this is the sort of thing that would look better if you took direct control of the palette. I'm not sure that's doable in MMF though (possibly with the shader extension?). Ideally though you'd have different palette maps for morning, mid day, afternoon, evening, night, and some number of in betweens and you'd interpolate each color between the steps based on their time. Not to knock your method of doing it of course. It just seems to overwhelm the picture a little too much for my tastes. Link to comment Share on other sites More sharing options...
Chaos-Fusion Posted June 17, 2012 Report Share Posted June 17, 2012 Looks pretty good. Whatever its being used for looks good so far with the inclusion of this Link to comment Share on other sites More sharing options...
Serephim Posted June 17, 2012 Report Share Posted June 17, 2012 Looks neat. Shouldn't this be directed more towards the R&D forum or something though? Or maybe a tutorial for the website or something? Link to comment Share on other sites More sharing options...
Strife Posted June 19, 2012 Report Share Posted June 19, 2012 I personally feel this is the sort of thing that would look better if you took direct control of the palette. I'm not sure that's doable in MMF though (possibly with the shader extension?). Ideally though you'd have different palette maps for morning, mid day, afternoon, evening, night, and some number of in betweens and you'd interpolate each color between the steps based on their time.Not to knock your method of doing it of course. It just seems to overwhelm the picture a little too much for my tastes. This. I would love the ability to do palette swaps in real time, because then we could animate things like waterfalls, blinking lights, and shiny crystals without making them active objects. Link to comment Share on other sites More sharing options...
Serephim Posted June 19, 2012 Report Share Posted June 19, 2012 if something like that was possible in MMF2 im sure it would be completely inefficient and resource consuming and would probably not be worth the effort Link to comment Share on other sites More sharing options...
Asuma Posted June 19, 2012 Report Share Posted June 19, 2012 This. I would love the ability to do palette swaps in real time, because then we could animate things like waterfalls, blinking lights, and shiny crystals without making them active objects. There's is a palette swap for Shader for MMF2, however, you can have up to 7 colors I think. https://dl.dropbox.com/u/32409323/PaletteReplacer.7z // Pixel shader input structurestruct PS_INPUT{ float4 Position : POSITION; float2 Texture : TEXCOORD0;};// Pixel shader output structurestruct PS_OUTPUT{ float4 Color : COLOR0;};// Global variablessampler2D Tex0;// Blue colorsfloat4 BDark;float4 BMid;float4 BLight;float4 OutL;float4 CDark;float4 CMid;float4 CLight;PS_OUTPUT ps_main( in PS_INPUT In ){ // Output pixel PS_OUTPUT Out; Out.Color = tex2D(Tex0, In.Texture); // Do a sum of the r, g and b values, 1 check is quicker than 3 float sum = Out.Color.r + Out.Color.g + Out.Color.b; // Look for the most common colors first, for efficiency, in those cases we can end the check early // Based on X's standard pose: // Outline (106 pixels in X) if (sum>0.282 && sum<0.283) { Out.Color.rgb = OutL; } // Blue Dark (106 pixels in X) if (sum>0.815f && sum<0.816f) { Out.Color.rgb = BDark; } // Blue Mid (48 pixels in X) else if (sum>1.192f && sum<1.193f) { Out.Color.rgb = BMid; } // Blue Light (44 pixels in X) else if (sum>1.474 && sum<1.475) { Out.Color.rgb = BLight; } // Cyan Mid (29 pixels in X) else if (sum>1.882 && sum<1.883) { Out.Color.rgb = CMid; } // Cyan Light (22 pixels in X) else if (sum>2.258 && sum<2.259) { Out.Color.rgb = CLight; } // Cyan Dark (15 pixels in X) else if (sum>1.129 && sum<1.130) { Out.Color.rgb = CDark; } return Out;}// Effect techniquetechnique tech_main{ pass P0 { // shaders VertexShader = NULL; PixelShader = compile ps_2_0 ps_main(); } }[code]Also, you have to manually edit the the .fx andxml files.In the fx file, you'll see something like "(sum>0.282 && sum<0.283)". Example. Mecha Sonic's lightest blue colors is128,132,232. You add those 3 values together. You divide the sum by 255. Then you take the first for numbers and write that down. This shader was written by someone at Sprites-Inc forums, so I'm going off memory.128+132+232 = 492 /255 =[b]1.929[/b]411764705882= 1.929. Then you add it like this.// Blue Dark (106 pixels in X) if (sum>0.815f && sum<0.816f) { Out.Color.rgb = [color=red]BDark[/color]; }That's the name you use in the xml file. Link to comment Share on other sites More sharing options...
Recommended Posts