About Store Forum Documentation Contact



Post Reply 
Yellow scene with hpRt(true)?
Author Message
SONB Offline
Member

Post: #1
Yellow scene with hpRt(true)?
Hi!

I made a star field with particles which are all white. Then I set hpRt(true), now my stars are yellow..
Why is that? How can I make them white again without deactivating hpRt?

Thanx!

SONB
02-08-2009 07:17 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: Yellow scene with hpRt(true)?
Hi, could you make a screenshot or something?
02-08-2009 10:07 PM
Find all posts by this user Quote this message in a reply
SONB Offline
Member

Post: #3
Re: Yellow scene with hpRt(true)?
Sure.

[Image: particles02by8.th.jpg]

[Image: particles01yq0.th.jpg]


EDIT: The renderer runs in RM_PRT_PAL mode. When I set it to RM_PRT_BLN the stars are white but very dark.
02-08-2009 11:43 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
Re: Yellow scene with hpRt(true)?
I'll do a quick sample on static particles (non fading out) and will be back to you soon.
02-09-2009 12:10 AM
Find all posts by this user Quote this message in a reply
SONB Offline
Member

Post: #5
Re: Yellow scene with hpRt(true)?
Cool grin

Oh, a quick question: The Particles.h says that I can make particles' life infinite when I set it to <=0 but I can't see my particles when I set their life=0.0; Do I understand it wrong or are there some extra settings I must change?
02-09-2009 12:21 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
Re: Yellow scene with hpRt(true)?
Hi, just to tell you, I think I won't make it today with the particles tutorial, I want to finish first the new clouds that I've started working on, I think tomorrow I'll be able to look into the particles smile
02-09-2009 01:12 AM
Find all posts by this user Quote this message in a reply
SONB Offline
Member

Post: #7
Re: Yellow scene with hpRt(true)?
On no problem, Esenthel! I think I can live without hpRt... till tomorrow grin
Nice to see you being busy with new features.
02-09-2009 01:29 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
Re: Yellow scene with hpRt(true)?
I've finished the clouds, now I can take a look into the particles
02-09-2009 02:32 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #9
Re: Yellow scene with hpRt(true)?
Hi, I've uploaded a new version of the engine, please download it.

I'm guessing that you're creating particles in PARTICLE_CUSTOM mode,
so for this please use createCustom method for particle creation
then you can set
func=PARTICLE_FULL; for full opacity mode

I believe it will be ok now
02-09-2009 04:03 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
Re: Yellow scene with hpRt(true)?
altough for maximum performance I encourage that you have stars embedded into your skybox
02-09-2009 04:13 PM
Find all posts by this user Quote this message in a reply
SONB Offline
Member

Post: #11
Re: Yellow scene with hpRt(true)?
Hm, there is no PARTICLE_FULL in Particle.h... only _SQRT and _SIN like before.

I'm not using custom particles, wanted to try it now but VC says "PARTICLE_FULL: undeclared identifier" :?
And yes, I downloaded the last version.. hmm
02-09-2009 04:36 PM
Find all posts by this user Quote this message in a reply
SONB Offline
Member

Post: #12
Re: Yellow scene with hpRt(true)?
Aaaah, sorry, my fault.. or Firefox's fault. It didn't really downloaded it just copied an old version from cache..
IE made it right.

Ok, I'll try the new settings now.
02-09-2009 04:44 PM
Find all posts by this user Quote this message in a reply
SONB Offline
Member

Post: #13
Re: Yellow scene with hpRt(true)?
Esenthel, I need your help :(

What has to be done with custom particles when they died? I mean, every frame I'm changing the position of each particle and when their life time is out I get "0xC0000005: Access violation writing location 0x0000000c" on *position = Rnd(Ball(6.0)); Do I have to manually reborn them or something?
Sorry, there is no tutorial for custom particles and I don't have a clue on how to work with them. The position changing did work with normal particles.

Here is my code:
Code:
Gfx *gfx = Gfxs("../data/gfx/particle/star.gfx");
UInt col = ARGB(100, 40, 40, 40);
Int num  = 2000;
Flt r    = 0.05,
    life = 7.0,
    vel  = 0;
Vec accel = 0;
Shape shape = Box(12, 12, 12);

part[0].createCustom(*gfx, col, num, r, life, accel, Rnd(Shape(shape)));
part[0].reset();
part[0].func = PARTICLE_FULL;

And in UpdateGame:
Code:
for(UInt n=0;n<2000;n++) {
    Particle *particle = &part[0].p(n);
        Vec *position = &particle->pos;
        *position = Rnd(Ball(6.0));
        
        while(position->length() < 10.1 || position->length() > 10.3)
            position->setLength(10.2);
}

And Render:
Code:
case RM_PRT_PAL:
            part[0].draw();
        break;

The Rnd(Shape(shape)) in createCustom(...) does nothing, so I do *position = Rnd(Ball(6.0)); for each particle in UpdateGame.
The particles live 7 sec till I get "Access violation" and even in these 7 sec I can't see my particles, so I assume I do something wrong in particle creation.
02-09-2009 08:16 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #14
Re: Yellow scene with hpRt(true)?
you should specify life of 0 (infinite)

don't do for(UInt n=0;n<2000;n++) {
but do REP(part[0].num())
02-09-2009 09:17 PM
Find all posts by this user Quote this message in a reply
SONB Offline
Member

Post: #15
Re: Yellow scene with hpRt(true)?
Thanx, Esenthel, I get no "access violation" but I still can't see my particles...
Do fade_in and fade_out play some role in custom particles? Because Particle.h says, they are equal life/2 and life is equal 0, so 0/2=0 ... I don't know, just a thought.

I would go back to non-custom particles but they are yellow. Does this yellow maybe something to do with the particle palette in engine.pak?
02-10-2009 12:37 AM
Find all posts by this user Quote this message in a reply
Post Reply