tulamide's Recent Forum Activity

  • The pixel size values define a fixed dimension of a digital image, whereas the ppi is a variable value defining how big the area will be that an image will use when printed out (ergo non-digital).

    You may have an image of 512x512 pixel and 72 ppi. If you now change the ppi to 144 the image area on the printed page will be half as big. But on the screen it is exactly the same size (unless you change the monitors resolution from normally 96 dpi to something else, but that would only be a visual difference, the screen will still display 512x512 pixel). It also means that the size on disk does not change for such an image with different ppi values. Try it yourself with photoshop. Create a new picture with 512x512 pixel in 72 ppi and save it as .png, then again create a new picture, this time 512x512 pixel in 144 ppi, and save it as png. Now compare the sizes on disk - they are the same. (Opening them in photoshop will show you that they are still defined as 72ppi and 144ppi)

    It is only confusing because photoshop allows you to use the print medium values as definition for a digital image (like 7.1x7.1inch instead of 512x512 pixel), but these values are as described above variable and depend on the ppi. If you would save a 7.1x7.1 inch image in 72ppi, and then one with 142ppi you would just double the pixel size on both axes, so the first one is saved with 512x512 pixel, wheras the second one is saved with 1024x1024 pixel. But both still have the format 7.1x7.1inch.

  • Tulamide how did you do those awesome water effects?.Mine is 75 fps 700 particles.

    Inspired by the quaziblobs, I created an effect doing it, let's call it the blob-shader. But it's not completed yet, that's why I didn't post it yet.

  • Damn

    I swear I will somehow get rid of my fear caused by the lack of language skills and join the chat

  • [EDIT] i think i also used your physics fix thing, sol gave it to me on chat

    What are you talking about? Everything that fixes something with the physics behavior is of interest to me, because I'm working on a physics based game idea, too

  • Do you know off hand if loops are unrolled at compilation? Or, likewise, if all the instructions in the branches of an "if" statement count as taking up instruction slots? It seems like they must, but I'm not sure what kind of optimization happens at compile time.

    There is also a time factor. If a loop uses only the allowed amount of instruction slots but is too time expensive, you will get an error too.

    If-statements count for every branch. A loop is one instruction plus the ones you enclose with the loop.

    float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float4 color = tex2D(foreground, Tex);
    	for (int i = 0; i < 1023; i++)
    	{
    		color *= 0.9999;
    	}
    	
        return color;
    }[/code:1qvuvolp]
    This code uses 3 instruction slots, being a loop with 1024 iterations.
    
    But as soon as you insert a simple if-statement you are using 3 instruction slots per iteration (the if-branch, the calculation and the not typed but still existent else-branch)
    [code:1qvuvolp]float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float4 color = tex2D(foreground, Tex);
    	for (int i = 0; i < 21; i++)
    	{
    		if (color.a != 0)
    		{
    			color *= 0.9999;
    		}
    	}
    	
        return color;
    }[/code:1qvuvolp]
    See? You now have to cap the loop to 21, which equals 21 * 3 = 63 instruction slots (plus the color assignment one line above)
    
    But be careful with extensive loops. You will use too much RAM. Better don't try the following example (I used the task manager to exit Construct after about 2 GB of RAM were assigned, and it took a very long time to get there):
    [code:1qvuvolp]float4 EffectProcess( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float4 color = tex2D(foreground, Tex);
    	for (int i = 0; i < 1023; i++)
    	{
    		for (int j = 0; j < 64; j++)
    		{
    			color *= 0.9995;
    			color /= 0.9995;
    		}
    	}
    	
        return color;
    }[/code:1qvuvolp]
    
    I'm not sure if attribute assignment is supported in Construct, I never tried it. HLSL generally allows you to add attributes to for- or if-statements (like [unroll] for for-statements or [flatten] for if-statements) to control compilation, but maybe Construct is taken care of that. You would need to try I'm afraid.
    
    [url=http://msdn.microsoft.com/en-us/library/bb509602%28v=VS.85%29.aspx]for-statement reference[/url]
    [url=http://msdn.microsoft.com/en-us/library/bb509610%28v=VS.85%29.aspx]if-statement reference[/url]
  • The method is called "premultiplied alpha" and is a standard in 3D (remember, Construct is based on DirectX). With this method the alpha is stored in the color channels when using rgb and stored in the color channels and the alpha channel with rgba.

    There are advantages and disadvantages to both methods, but the most important advantage is the speed factor. Calculations are less complex and speed up the process and that is essential in 3D-environments.

    You don't really lose precision, because you're working with relative values 0 to 1 in 32-bit-precision (The smallest representable number without losing precision is 1.401298464e-45). It's the picture model that may lose precision (e.g. 8-bit-colors).

    The way you work with the colors in an effect is simple:

    1) Calculate the alpha out of the rgb-channels before working on the color

    color.rgb /= color.a;[/code:2apdu4tj]
    2) Work on the color
    
    3) Calculate the alpha back in
    [code:2apdu4tj]color.rgb *= color.a;[/code:2apdu4tj]
    
    [url=http://en.wikipedia.org/wiki/User]Here is a very good summary of premultiplied alpha[/url]
  • If you can have a hand on photoshop, you can do that with the option called slicing. Then just export and select all slices.

    Also, I found an online splitter, but didn't try it myself: http://www.htmlkit.com/services/is/

  • I'm using "Play music from resource" under Xaudio 2's music tab. I think the pause is due to the filesize, since the song is a .wav file, but I could be wrong. I normally use ogg but it seems ogg only works for sounds.

    If you are using a .wav file, you could use it as a channel sound instead of music, which enables you to cache it

  • Q1: How much do I need to know about the pixel shader 2.0 limitations to code shaders that rely on convolutions?

    Basically, the only limitation you need to be aware of is that you only have 64 instruction slots. Esp for convolution effects it will limit you too much. You may get away with a 3x3 matrix, although I doubt it.

    Q2: Is there any good online reference for what you can and can't do in pixel shader 2.0.

    I suggest you use the official HLSL reference. You just need to accept that with Construct's implementation not all intrinsic functions work, even if they are said to work under ps 2.0 (e.g noise). You won't get any error messages then, it seems as if they just got lost in the dark universe of dead bits

    Q3: Is DirectX's "HLSL" language what construct shaders are coded in?

    See above

    Q4: Is it possible to make shaders that distribute their computation complexity over multiple passes, if the algorithm is to complex for a single pass?

    No, Construct limits you to single pass.

    EDIT: 1 addition, "pixel shader 2.0" is a profile, this links explains what it means: http://msdn.microsoft.com/en-us/library ... 85%29.aspx

  • I'm working on an effect that replaces colors by index. And this is much harder than I thought, when I started a few month ago. I'm at a point, where I don't make any progress. There are too many questions and issues, and I really don't know which way to go.

    That's why I think it's time to get the community involved. First I will give you an impression of what is currently possible, without giving to much dry information. Please download this .rar:

    C-DEX Demo.rar

    It contains two apps that demonstrate the effect (The second demo uses Disk.fx in addition). If you think it is worth developing it, I will post all information about how it works, together with its advantages and disadvantages. And the issues that lead me to ask for your help...

  • Maybe I didn't understand you right, but I had no problems with you cap. If I set e.g.

    +Blobby: Value "from_Layout" equal to "Layout 1"

    ->Blobby: Set X to 0

    ->Blobby: Set Y to 1930

    Blobby appears exactly there.

    EDIT: Ok, sry, you already did it

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That isn't half bad. I like it. Nice sounds and the music carries the spirit of the 8-bit era

    A couple of proposals:

    1) Add an option to change the volume of the sounds/music. I played with headset and the music was way too loud.

    2) Integrate an about screen instead of a message box. It would add to the atmosphere.

    3) Make the enemies more "lively". Even if they just move their eyes.

    4) The start screen is a bit drab. Maybe you could pep up the buttons, add some art to the background, something like that.

    5) For the HUD, why not using icons for all the parameters instead of only the bomb?

    6) Although I like the music, the loop is too short if it's the only one you will hear throughout the game.

    7) Music muting via "s"-key should unmute as well.

    ...and add some peas

tulamide's avatar

tulamide

Member since 11 Sep, 2009

Twitter
tulamide has 3 followers

Trophy Case

  • 15-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

17/44
How to earn trophies