Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Raizor

Pages: [1] 2 3
1
Projects / Sundowner - Intro Sourcecode
« on: March 05, 2013 »
I've attached a RAR file containing the sourcecode to "Sundowner", the intro I released at the Sundown 2012 demo party. It's build against Visual Studio 2010 in C++ and uses OpenGL for rendering and 4kLang (by Alcatraz) for sound.

The code is pretty messy but shows how to use VBOs for drawing instanced objects (the cube logo at the beginning and the cube based greets screen). There's also some raymarching (for the Menger sponge and Julia) but there are much better examples if you want to get into Raymarching as the shaders are a bit of a mish-mash.

Anyway, here it is, do whatever you like with it :)

Cheers,

Raizor

2
I've been doing some LUA work recently and have also upgraded to Visual Studio 2012. Unfortunately, there's no LUA plugin for VS 2012 to support syntax highlighting etc. I decided to have a go at porting VSLua over to VS 2012 and it's worked well.

I've attached the extension to this post in case anyone else would find it useful.

Cheers,

Raizor

EDIT: I've also attached the source to this post too.

3
C / C++ /C# / Fonts in 64k intros
« on: September 30, 2012 »
I was wondering if anyone had any thoughts or suggestions for handling fonts in 64k intros?

The normal approaches seem to be either a 1 bit bitmap font (black & white) or using existing system fonts (TTF such as Arial etc). Both of these methods seem quite limited to me, so I'm wondering if there are alternatives. I guess the SDF font stuff Hellfire posted about a little while ago would be excluded on size grounds as it needs a fairly large PNG to represent distance fields. My only other thought would be to write something to process existing vector based fonts and somehow recreate these in code using a minimal number of points and some curves (bezier or whatever). I can see this last technique being quite difficult to implement, so I wonder if anyone else has an other insights?

Cheers,

raizor

4
C / C++ /C# / C++: SSE2 and NODEFAULTLIB
« on: August 02, 2012 »
Does anyone know if it's possible to use SSE2 extensions when using the NODEFAULTLIB flag? I'm just wondering if theres some neat workaround that will give me the speed advantage with minimal code size increase. Any suggestions would be great, thanks.

5
C / C++ /C# / C# PadSynth Implementation
« on: July 11, 2012 »
I've been planning on implementing the PadSynth algorithm into my synth and finally got around to having a play around with this stuff. I decided to make a test app in C# before writing a C++ for implementation for the synth.

Attached is a little C# app (with source), that generates a few PadSynth wavetables and lets you play them back. There seems to be a bug with the Guitar sounds as they overdrive/distort even at very low volumes. I'll have a look at that and hopefully fix it up tonight or tomorrow. There are no keyboard controls or anything like that, so everything plays at a fixed pitch.

I'll post again later with a bit more info.

Cheers,

Raizor

6
This is probably a long shot, but I wondered if anyone had any suggestions for overcoming a problem I'm experiencing.

A little bit of background info to explain the problem:

My soft synth is written in C++, in the form of a lib file. When the synth is used for a demo/intro, the demo will simply link to the lib in order to use it.

For the synth VST GUI, I have a C++ DLL that contains the lib file for the synth. My synth interface is written in C# and I communicate with the synth via a C++ DLL (which links to the synth lib and acts as a wrapper for the synth and exposes various method to initialize the synth, get/set params and patch names etc). The C# GUI communicates by using PInvoke to call the methods in the DLL, which in turn calls methods in the synth lib code.

My problem is that when debugging, the C# code calls a method in the DLL to initialize the synth which creates all the synth parts in memory (patches, wavetables etc etc). When debugging terminates, I'm left with a rather large memory leak as the memory allocated by the native code is not freed. After a few test runs in Visual Studio using the debugger, I'm out of memory.

I'm wondering if there is any way round this without having explicit cleanup code in the DLL to free the memory? I'm also concerned that if I do add code to free the memory, I will have no way to call it when debugging terminates and execution is suddenly halted before I get a chance to fire off a call to the cleanup code and free the memory.

Any suggestions most appreciated, many thanks,

Raizor

7
C / C++ /C# / C# GM.DLS Parser (with source)
« on: June 23, 2012 »
Attached is a little C# based GM.DLS parser (with source). It allows you to play the various sounds in GM.DLS and see information relating to the instruments.

Feel free to do whatever you like with it (or the code).

Here's some info from the readme:

GM.DLS Parser by Raizor v0.1
-----------------------------

Quick and dirty GM.DLS parser. I created this to help me experiment with the GM.DLS file and locate the various instruments for later use in a synth.

This will scan the DLS file and read the instrument details from the data. It then cross references the instrument with the wave data pool to locate the wave file data for the instrument. It allows you to cycle through the instruments and play them. I haven't added support for looping yet or the ability to export the sounds.

Usage:

1. Click "Process" and locate your GM.DLS file.
2. Use the combo box to select an instrument.
3. Press "Play" to play the sound.

A number of instruments contain links to multiple waves. This is done as there are often several versions of a particular wave at different pitches. Each wave is marked in the DLS with a note number. This app currently only plays the first wave for an instruemnt (usually Midi Note 20).

That's it for now. Thought this may be useful to someone. I'll probably end up updating it soon to add looping playback (and maybe envelopes).

Thanks: Jim and Blackpawn for thier DLS tools which I used as a reference when making this.


EDIT:

Attached a new version that supports saving the instrument sounds to .wav files.

8
Here's the source for "Menger's Mice" my entry to the DBF cubes challenge. It's written in C++ and the solution/project files are in Visual Studio 2010 format.

Source is pretty messy (as per usual), do whatever you like with it :)

There's no packing/crunching included in the build configurations. You'll need to do that manually. I was getting ~50kb exe with Kkrunchy.

Cheers,

Raizor

9
C / C++ /C# / C++ Calling Conventions
« on: May 31, 2012 »
I'm just curious about the implications of using different calling conventions in C++ projects. IQ's 64k framework (which has been my goto reference for a lot of things), uses _fastcall calling convention. I've used the same for 'release' builds of most of my stuff, and 'cdecl' for debug builds. Is this something I should spend some time studying? Does it impact code-size and execution speed much?

It's popped up on my radar again due to me working with native C++ and managed C++ and having to fiddle around with calling conventions to get things to work together properly.

Any insight would be great, thanks.

10
General chat / Happy Birthday Padman
« on: May 11, 2012 »
Happy Birthday Padman, have a great one! :)

 :clap:

11
Challenges & Competitions / [CUBES] Menger's Mice
« on: April 27, 2012 »
DBF CUBES CHALLENGE 2012: "Menger's Mice are eating my cheeze cube!"
---------------------------------------------------------------

 Code & Gfx   : Raizor
 Music            : Melw/SQNY
 Released      : April, 27th 2012
 
---------------------------------------------------------------

Here's my entry to the Cubes challenge. Hope it works :)

You can grab the sourcecode here.

Youtube vid capture from FRAPS:

* video is a bit grainy and glitchy I'm afraid *

<a href="http://www.youtube.com/watch?v=egjNWc46bX4" target="_blank">http://www.youtube.com/watch?v=egjNWc46bX4</a>

12
C / C++ /C# / Help with jerky scroller problem
« on: April 26, 2012 »
All my OpenGL stuff so far that has included a scroller has suffered from a degree of jerkiness and I'd like to get my head around the problem if possible. I'm probably doing something wrong with my timing, so if anyone has any suggestions, I'd appreciate it.

As you're probably aware, I use IQ's 64k OpenGL framework as a base for most of my stuff. This uses timeGetTime() for timing. As suggested in various places (including here), I call timeBeginPeriod(1) at startup and timeEndPeriod(1) when my intro finishes. I understand that timeGetTime() works in milliseconds, so I wonder if the issue is related to the value not being granular enough.

My timer code looks something like this:

static long startTime = 0;
if( !startTime )
{
  // set start time
  startTime =timeGetTime();
}
float timeElapsed = 0.001f * (float)(timeGetTime() - startTime);


Using this for animating objects and the like works nicely and things appear smooth. However, when I use the timeElapsed to calculate an offscreen for scrolling a scroller it seems to jump about and looks quite jerky at times. I do something along the lines of:

scrollOffset = -timeElapsed*FloatValToControlScrollSpeed

The scroller is sometimes smooth, but goes through periods of jerkiness. I'd like to avoid using the swap interval GL extension if possible to ensure it runs nicely on machines where VSync is forced off in the gfx driver settings.

I should also point out that the framerate never drops below about 200 fps.

If anyone can see something I'm doing wrong or has a solution, please let me know.

Thanks,

Raizor



13
I've been playing around with ray marching again and it got me thinking about a scene modeller for ray marching. Do you think people like Psycho have an own made tool like this for creating procedural gfx compo entries or would they be done by hand?

I'm toying with the idea of having a go at a basic modeller (in breaks from synth coding) as I think it would be a fun and hopefully useful tool. As scenes get more complex, realtime animation may go out of the window but I can see it being pretty cool for making logos for size limited productions or other things.

Has anyone come across anything like this before?

14
General chat / Source code for all Farbrausch tools
« on: April 15, 2012 »
Source code for all Farbrausch tools:

https://github.com/farbrausch/fr_public/downloads

Blimey! Quite excited is an understatement.

15
General chat / Cool stuff from Revision 2012
« on: April 08, 2012 »
A lot of the Revision 2012 compo entries are now on Pouet. Worth checking out as some are very nice indeed.

Not sure if many of you are aware of the Moleman 2 demoscene documentary, but that was finally released at Revision too and is available to watch on Youtube:

<a href="http://www.youtube.com/watch?v=iRkZcTg1JWU" target="_blank">http://www.youtube.com/watch?v=iRkZcTg1JWU</a>

16
I've been hunting around trying to find some info on creating a mesh from a windows font on the local system in OpenGL. It seems it's a lot easier to do in DirectX than OpenGL. Has anyone done anything like this before or know of a resource with info please? 

17
Coding tutorials / Demoscene Seminar Videos
« on: February 24, 2012 »
I thought I'd put together a thread listing the various demoscene seminars from various demo parties as there are quite a few out there that I've missed until recently. Feel free to add or edit.

Audio

Function 2011: Seminar Music in 4k - Size-Optimized Synthesizer Programming by Ferris:

<a href="http://www.youtube.com/watch?v=G2SBjeXEjZo" target="_blank">http://www.youtube.com/watch?v=G2SBjeXEjZo</a>



Tools & General
Function 2010 Seminar: Tools for 4k intros by Aske Simon Christensen (Blueberry / Loonies):

<a href="http://www.youtube.com/watch?v=9b9xuRfooXM" target="_blank">http://www.youtube.com/watch?v=9b9xuRfooXM</a>



Assembly Summer 2010: Fairlight's rendering secrets (Matt Swoboda [Smash]):

<a href="http://www.youtube.com/watch?v=ZiPGd3DDfMU" target="_blank">http://www.youtube.com/watch?v=ZiPGd3DDfMU</a>



Assembly Summer 2011: The Basics of Demo Programming (Martti Nurmikari):

<a href="http://www.youtube.com/watch?v=TbcZyAO6K7c" target="_blank">http://www.youtube.com/watch?v=TbcZyAO6K7c</a>



Breakpoint 2008: Tonite let's all make demo in Bingen (Navis / ASD):

<a href="http://www.youtube.com/watch?v=nazHdPoA_3o" target="_blank">http://www.youtube.com/watch?v=nazHdPoA_3o</a>



18
I've been playing around with the MiniFMod source and I'm confused by the line highlighted below.

FSOUND_SAMPLE is a struct with a 'length' property. I'm trying to work out how the line below actually works. I would expect a reference to an instance of FSOUND_SAMPLE to be there as that doesn't look right to me at all. Am I missing something?

If I try to compile the code as C++ (instead of C), I get the following error against that line:

Error   8   error C2420: 'FSOUND_SAMPLE' : illegal symbol in second operand


Thanks

Raizor

Snippet:

   CalculateLoopCount:
      mov      mix_count, eax
      mov      esi, [ecx].mixpos
      mov      ebp, FSOUND_OUTPUTBUFF_END   
      mov      mix_endflag, ebp         // set a flag to say mixing will end when end of output buffer is reached

      cmp      [ecx].speeddir, FSOUND_MIXDIR_FORWARDS
      jne      samplesleftbackwards

      // work out how many samples left from mixpos to loop end   
      mov      edx, [ebx].loopstart
      add      edx, [ebx].looplen
        cmp     esi, edx
        jle     subtractmixpos
        mov     edx, [ebx+FSOUND_SAMPLE.length]

19
I'm currently working on something that could do with a few touches to finish it off.

I have a logo made of cubes (3d pixels). The pixels are placed randomly in 3d space and fly to their final positions to form the logo. I'm currently using a lerp and staggering the start times of the cubes, which looks ok but is really missing something.

I was wondering if anyone had any suggestions to make the movement more interesting. I'm doing this in a vertex shader, so ideally whatever I do shouldn't be overly processing hungry as it's called for a lot of vertices.

I'm thinking of interpolating between the source position and destination via an intermediate position (with some kind of weighting for the intermediate position based on the current position between source and destination).  I'm sure I had some code from years ago to do something like this on the PS2, but can't for the life of me find it. Any ideas or suggestions would be great, thanks.

20
General coding questions / Learning ASM
« on: January 24, 2012 »
I'm just wondering what would be the best approach to learning ASM. My aim would be to become familiar with x86 ASM but I'm wondering whether to bite the bullet and start there or spend some time on Z80 ASM or something else more simple first to get myself familiar with the basic concepts?

Any suggestions would be cool, thank you.

Pages: [1] 2 3