Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Tuners
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

      1. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

WMP Visualization


Haro
 Share

Recommended Posts

Hi, this is my first viz (visualization) for WMP so it's not very good but i will improve on it. I first tried to make a custom viz months ago, but i only had Visual Studio Express Edition which didn't include the Platform SDK and ATL. Also, i am fairly new to C++, especially to Microsofts libraries (ATL and that). Eventually i got the required libraries and compiled the project.

Feel free to change the code and give my tips on how to improve it. I've included the

VS Project so you can compile it. If you just want to run it, you will have to register

the DLL using regsvr32.exe (command is "regsvr32.exe [DLL Name]").

 

Download Here

Enjoy smile.gif

Link to post
Share on other sites

  • 3 weeks later...

Version 1.1 is now up. I've improved the code a bit, changed a few of the presets and most importantly added double buffering to stop the flickering. It's slightly faster but i read that using a cached Bitmap is even faster but i see no improvement. I want to know how to make those complex patterns that are in other viz's (Pixel Trip is a great one), if anyone knows of a good site please tell me.

 

Download

Link to post
Share on other sites

  • 3 weeks later...

I am making another visualization, Viz3D, which will use OpenGL to draw 3D shapes and stuff. I have got the code done and it compiles (using VS) but nothing appears on the screen when i run it. Can someone please look at my code and tell me what's wrong with it. I know K^2 has done OpenGL so if he or anyone else could help me that would be great smile.gif

Download Viz3D here

Link to post
Share on other sites

I haven't looked at the code yet, but did you try running rendering code as a stand-alone executable? It's a good way to see if you messed up the rendering code itself or something in Application-Library interface.

Link to post
Share on other sites

 

I haven't looked at the code yet, but did you try running rendering code as a stand-alone executable? It's a good way to see if you messed up the rendering code itself or something in Application-Library interface.

Well that's the thing, i basically copy/pasted the code from an example i got with Dev-C++. I first learned about OpenGL when i downloaded Dev-C++, saw some OpenGL examples and realized how easy it was. So i just copied it into my ziv, i initiallized it in my Render function (which is passed the HDC) and did all the PIXELFORMATDESCRIPTOR stuff:

 

if (starting) {     // starting is initiallized to true   PIXELFORMATDESCRIPTOR pfd = ...   other init stuff   starting = false;}

 

 

I just looked on MSDN for PIXELFORMATDESCRIPTOR and found:

dwFlags

PFD_DRAW_TO_WINDOW.....The buffer can draw to a window or device surface.

PFD_DRAW_TO_BITMAP.......The buffer can draw to a memory bitmap.

PFD_SUPPORT_GDI..............The buffer supports GDI drawing. This flag and PFD_DOUBLEBUFFER are mutually exclusive in the current generic implementation.

PFD_SUPPORT_OPENGL........The buffer supports OpenGL drawing.

...

 

Is that the problem? Do i need to set it to draw to window or bitmap or something?

Edited by Haro
Link to post
Share on other sites

Ok, don't worry. I've fixed the problem and got it to work. I needed to put 'SetPixelFormat(...);' before 'hrc = wglCreateContext(hdc);' also, the code which used when the window was resized (in the example) was also used to initialize it. So i put that in and it works fine now smile.gif

Download

Link to post
Share on other sites

  • 3 weeks later...

All right, i've just uploaded the latest version of Viz3D. I added a new preset that draws swirling stars that change colour to the music. The star preset is modified from sample code that i got from a tutorial at http://nehe.gamedev.net

 

I couldn't get it to load the star image (bitmap) from file because i don't know the working directory of the player (i thought it would be where the viz dll is but no). Therefore i used the abolute path to the file. The path is: "C:/Program Files/Windows Media Player/Visualizations/Viz3D/release/Data/Star.bmp" so if you unzip the Viz file to the Visualizations directory you should be fine

but otherwise you will have to change the code yourseft.

 

Download

Link to post
Share on other sites

  • 2 weeks later...

Ok, i've uploaded yet another version. The previous one had a problem with the textures. I wasn't disabling the texture when it rendered a preset that didn't use textures so nothing was getting drawn. I fixed that and added a radial blur effect that i got from http://nehe.gamedev.net.

 

Download

Link to post
Share on other sites

  • 2 weeks later...

Hi again. Version 1.4 is now up and i am currently working on the blur effect. I am trying to combine the radial blur and motion blur into a single effect, so the blur can be along the z-axis (moving into the screen) and also moving laterally across the screen. This will give the effect that the screen is moving around and leaving a blur trail.

 

I decided to put up some screenshots so you can see what it looks like. Here are a few presets:

user posted image user posted image user posted image

 

Download

Link to post
Share on other sites

  • 3 weeks later...

Here is Version 1.5. I have added a cool warp effect that a lot of professional visualizations have. Basically I just copy the screen to a texture, warp it, then render it as the background. The result is that the image moves and seems to melt away.

I started on a more advanced warp where the texture was divided into squares which were warped according to some algorithm (e.g. sin wave) but had a few problems with it. I fixed all that, and so i am putting up the working version of it. It swirls each square using a sin wave to achieve a whirlpool effect, i hope to add more warp algorithms soon.

 

Here is a screenshot of the effect.

user posted image

 

Download

Link to post
Share on other sites

I never really messed with visualization plugins. How do you install one?

Link to post
Share on other sites

I mentioned it in the first post;

 

If you just want to run it, you will have to register

the DLL using regsvr32.exe (command is "regsvr32.exe [DLL Name]").

 

So you would type "regsvr32.exe Viz3D.dll" in command prompt in the folder where the dll is. I don't know what it does exactly, but basically it is to tell Windows Media Player that there is a new visualization.

Link to post
Share on other sites

Hmm... When I try that, LoadLibrary function fails in the regsvr32.exe.

Link to post
Share on other sites

Interesting... i have no idea what that means. dontgetit.gif

Have you tried just compiling the VC project? You may need some additional libraries such as the PlatformSDK although you may already have that if you have the full version of Visual Studio.

If you don't have it you can download it from MSDN. I got a free version of VS2005 from MSDN, the PSDK is also free.

Edited by Haro
Link to post
Share on other sites

I haven't used Visual Studio or VC++ in ages. I prefer to use Dev-C++.

Link to post
Share on other sites

Yeah, i use that sometimes. In fact, that is where i first used OpenGL. There was a sample GL app and it looked so easy to do i started doing stuff with OpenGL.

But about your problem, what exactly does regsvr32.exe do/say when you try to register the dll? I just googled it and got this from MSDN. It mentions that the LoadLibrary problem is caused because it can't find the dll so make sure you type the full name (path and file name in " & " i think). Or a file it needs is missing.

Link to post
Share on other sites

  • 1 month later...

I have improved the warp effect, added a few more and randomly alternate them with a transition effect that makes the warp move slowly from one preset to the next. I have also added mouse control so the warp and blur, can be moved/zoomed in & out. I will upload that once i have fixed the bugs

Link to post
Share on other sites

  • 4 weeks later...

I am making a snake like curve that moves around the screen. It uses 3 point bezier curves joined together to form one long curve. The head continually grows while the end disappears. I need to make each new one connect to the old head but my code doesn't work.

 

typedef struct tagBezier{   float x, y;         // Curve position   POINTF P0, P1, P2;  // Control points   float t, t2;        // Time variable [0-1]} Bezier;void CViz3D::calculateBezier(Bezier& b, float time) {   b.t2 = b.t;  b.t = time;   b.x = (pow(b.P0.x*(1 - b.t),2) + b.P1.x*2*b.t*(1 - b.t) + pow(b.P2.x*b.t,2));   b.y = (pow(b.P0.y*(1 - b.t),2) + b.P1.y*2*b.t*(1 - b.t) + pow(b.P2.y*b.t,2));}void CViz3D::drawBezierCurve(Bezier b[CURVES]) {   float iStart = 0, iEnd = 1;   if (b[start].t < b[start].t2) {  // Change position if finished       int sOld = start;   // Previous start pos       start = (start+1)%CURVES;       end = (end+1)%CURVES;       float distX=b[sOld].P2.x-b[sOld].P1.x, distY=b[sOld].P2.y-b[sOld].P1.y;       b[start].P0.x = b[sOld].P2.x;       b[start].P0.y = b[sOld].P2.y;       b[start].P1.x = b[sOld].P2.x+distX; b[start].P1.x = b[sOld].P2.y+distY;       b[start].P2.x = (RAND-0.5f);        b[start].P2.y = (RAND-0.5f);   }   for (int j = 0; j < CURVES; j++) {       if (j == start) {  iStart = 0;  iEnd = bezTime; }       else if (j == end){ iStart = bezTime; iEnd = 1; }       else { iStart = 0; iEnd = 1; }       glBegin(GL_LINE_STRIP);       for (float i = iStart; i < iEnd; i += 0.01f) {           calculateBezier(b[j], i);           glVertex2f(b[j].x, b[j].y);       }       glEnd();   }}

 

 

Can someone figure out what's going on.

Thanx

Edited by Haro
Link to post
Share on other sites

  • 4 months later...

Finally the wait is over!... ok, so you haven't been waiting but it's here anyway, the latest version. smile.gif

Download here

I got the warp files and editor working so you can now edit and display cool warp patterns of the image on screen. Here are some screenshots:

Viz3D

user posted image user posted image user posted image

Warp Editor

user posted image

 

enjoy smile.gif

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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.