Just some questions

All topics about ZGameEditor goes here.

Moderator: Moderators

User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:idea:

Ah, I know what's going on .. since you're using the build-in collision components, you need to set the category of your Fade model higher then all others ( to make it render last ). That way you won't have to use depth-sorted.
jinxtengu wrote:strangely the error doesn’t appear like most errors in the little window on the right of the screen, it only happens when the project is run.
Functions defined in a ZExternalLibrary can only be called after the component has been executed. That's why you only get the error during run-time.

K
jinxtengu
Posts: 122
Joined: Wed Oct 14, 2009 2:05 pm
Contact:

Post by jinxtengu »

Hi again,

I'm still working on my small first person 3d game.

can anyone suggest how to have 3d objects fade as they become further away from the camera?
this would look a bit classier than having them just appear from a far away distance.
I don't really know how to approach this problem. any ideas?

--------------------------------------------------------------------------
also I converted a long mp3 song into raw format and tried
playing it in a game. It plays but after about 9 seconds it stops and repeats, I'm not sure why it does this. ??
changing the note length doesn't seem to make a difference.
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi,
jinxtengu wrote:can anyone suggest how to have 3d objects fade as they become further away from the camera?
Do you really need this? Virtually no games use this method .. but perhaps you want to do this from a artistic stand-point, not for performance? It's definitely not as easy as it might sound ( when you want to do it properly ).
jinxtengu wrote:I converted a long mp3 song into raw format and tried playing it in a game.
You probably don't want to do this. You can't stop sounds, can't loop them properly ( which might be important for BGM ), they are mono-only ( so you need 2 for stereo ) and you end up with enormous files. Use a DLL to play a external mp3 instead .. although I'm not sure why there isn't a component for this as both Windows and SDL support this natively.

K
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Here is a project that plays mp3 on windows using MCI-commands. Put a mp3-file called "test.mp3" in the same directory as the zgeproj-file.
Attachments
mp3test.zgeproj
(940 Bytes) Downloaded 456 times
jinxtengu
Posts: 122
Joined: Wed Oct 14, 2009 2:05 pm
Contact:

Post by jinxtengu »

Thanks Ville, the Mci commands are useful.
Do you really need this? Virtually no games use this method .. but perhaps you want to do this from a artistic stand-point, not for performance? It's definitely not as easy as it might sound ( when you want to do it properly ).
I was playing a play-station one game and noticed an effect like that, and i was wondering if I could do something similar. I don't really need it.

I tried putting the main character in my game inside several varying size 3d spheres which displayed the back-faces and were partially transparent,
this sort of produced the effect I was after but it slowed down the game too much to be of any use.
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:)
jinxtengu wrote:I was playing a play-station one game and noticed an effect like that, and i was wondering if I could do something similar. I don't really need it.

I tried putting the main character in my game inside several varying size 3d spheres which displayed the back-faces and were partially transparent,
this sort of produced the effect I was after but it slowed down the game too much to be of any use.
Ah, you probably mean fog instead then ( which influences the color of rendered objects, not the alpha ).

Image

This is build-in OpenGL and is very easy to use .. apart from the fact that you can't set the fog color from ZGE, so you're stuck with black .. unless you do-it-yourself using shaders. In any case, attached is a example.

K
Attachments
Fog.zgeproj
(1.29 KiB) Downloaded 444 times
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

Here's an example I believe jph created some years back, using shaders.
Attachments
GLSL_fog_simpleZ.zgeproj
(2.08 KiB) Downloaded 445 times
"great expectations"
Post Reply