Hello Guest

Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Help / Multipass shaders in Otter2d
« Last post by KrissLaCross on November 01, 2016, 03:15:13 PM »
Hi!

So I'm trying to implement a basic multipass shader using this tutorial: https://gamedevelopment.tutsplus.com/tutorials/how-to-write-a-smoke-shader--cms-25587
But I'm struggling with seting up the multipass system aka "The Frame Buffer Trick".
The simpel algorithm goes as follow:
  • Pass A through your shader, render onto B.
  • Render B to the screen.
  • Pass B through shader, render onto A.
  • Render A to your screen.
  • Repeat 1.

Where A and B are either two textures or two buffers. I decided too use two Surfaces, because that makes it easier to create some cool stuf later on.
But I'm struggling with step one, I'm just not really sure how too do this in Otter2d. I tried the following:
Code: [Select]
bufferA.Shader = shader;
bufferB.Draw(bufferA);
bufferB.Render();
tempBuffer = bufferA;
bufferA = bufferB;
bufferB = tempBuffer;

using the this simpel shader:
Code: [Select]
uniform sampler2D texture;

void main() {
vec4 color = texture2D(texture, gl_TexCoord[0].xy);
color.r += 0.01;
gl_FragColor = color;
}

But sadly it doesn't work and I don't know what I'm doing wrong.

I appreciate any help!
Thanks for your time!

~KrissLaCross
22
Help / Re: Tile Pixel Manipulation
« Last post by Lycake on October 22, 2016, 09:37:40 AM »
Thanks for the quick reply!

Hm is it possible to only color the grayscale part of the sprite? Coloring the whole tile wouldn't work because I have fixed colored parts that shouldn't be tinted and stay as they are.

Oh and yes I have requested a slack invite but havn't gotten any email yet (yes I checked the spam folder)
23
Help / Re: Tile Pixel Manipulation
« Last post by Commanderstitch on October 22, 2016, 09:23:52 AM »
I usually just white/greyscale my sprites/tiles and set them to whatever color i want at runtime. That's just what i do atm. I've never tried this pixel manipulation of individual pixels since c++. Good luck with your stuff! I'll see if i can't get others to read this on the forum and check it out. Most of us are in the otterslack. join up and have a chat. we'd love to see you.
:-)
24
Help / Tile Pixel Manipulation
« Last post by Lycake on October 22, 2016, 08:38:22 AM »
Hello!

I am using a tilemap similar to the principle of the game Dwarf Fortress. It works like this: You have transparency, gray pixels, and colored pixels on the tiles. Together with the tile number, you get a foreground and a background color. The the transparency defines the amount of background color on that pixel, the gray pixels the amount of foreground color and the colored pixels are unchanged.

This makes it so you can use the same tiles for different objects in your game - colored differently. For example you can have a bucket out of copper or iron (using a reddish or gray foreground color), while having pre-colored blue water with one single bucket tile.

Now my problem is, that I need to change the gray pixels in my tiles to the foreground color (or rather merge it, because I need various degrees of foreground color brightness, depending on the darkness of the gray pixel). I can't seem to find an approach that works. I couldn't find a way to change my tiles on a pixel per pixel basis manually and my other thought was using a shader, but shaders only work on the whole tilemap and not on individual tiles. Coloring the whole tile also changes the true colors in the tiles, which should stay unchanged.

I know this forum isn't very active anymore, but I really hope someone has an idea how to solve my problem. I really like otter so far and hope I can use it with this project of mine.

Thank you,
Lycake
25
Ideas / Re: Embedding in WinForms
« Last post by Kyle on October 12, 2016, 07:56:46 PM »
Hmm I can't make any promises on this front. This seems to require a core modification of the game loop. If I can figure out a good way to implement this in the current API without changing a bunch of stuff, then I can check this out.  My current priorities at this point are to fix a few more bugs in the engine, and convert it over to the FNA runtime sometime next year.

This definitely would be possible though on your own branch if you want to fork it and modify the loop in Game.cs to work with a windows form.
26
General / Re: Atlas and Animation
« Last post by plague_boy on October 12, 2016, 01:19:28 AM »
Heh, no worries Kyle.

I'm just happy to be having fun again. Otter has got me out of a loooong creative funk.

N
27
General / Re: Atlas and Animation
« Last post by Kyle on October 11, 2016, 08:02:05 PM »
Unfortunately right now there's no such support -- the only support for TexturePacker atlases is using an atlased image as the source for a spritemap.  I'm not sure if I'm able to add support for this in the near future, sorry :I
28
General / Atlas and Animation
« Last post by plague_boy on October 11, 2016, 08:22:26 AM »
Hi folks, I'm an Otter newbie and this may be a really dumb question but is there any way to use sprite names  - generated from TexturePacker to create sprite animations?

example:

sprite.add(Animation.idle, "player_idle1, player_idle2, player_idle3", 3);

Cheers,

Nick
29
Ideas / Embedding in WinForms
« Last post by xaviergonz on October 03, 2016, 11:44:29 AM »
Is there a way to make otter be embedded into a winforms control? (basically use a different target HWND handle upon creation?)
I want to make an editor and use WinForms for the side UI.

Something like done with SFML.net here:
http://en.sfml-dev.org/forums/index.php?topic=9141.0

The post that contains "Just paste this into any new C# Win Forms Application. I just threw this code together for behind a form named Form1."
30
Help / Re: Anti-aliasing
« Last post by Kyle on July 18, 2016, 03:34:58 PM »
The best you can do with Otter is just the default smoothing that openGL offers on textures, I think.  You can set the Smooth bool to true or false on any surface or texture.

To access the fps info without having to open the console you can use something like:
Code: [Select]
Otter.Debugger.Instance.ShowPerformance(1);Or just directly use the console as commanderstitch says.
Pages: 1 2 [3] 4 5 ... 10