Kevin
Member
|
Black rim in multipass
Hi,
I've got a issue with a black rim around my player's sword...
it only appears in multipass mode, and I don't know why.
Screenshot:
Any suggestions?
|
|
12-08-2009 04:23 PM |
|
Esenthel
Administrator
|
RE: Black rim in multipass
it looks like you're drawing the sword in EarlyZ mode with different matrix
|
|
12-08-2009 04:44 PM |
|
Kevin
Member
|
RE: Black rim in multipass
(12-08-2009 04:44 PM)Esenthel Wrote: it looks like you're drawing the sword in EarlyZ mode with different matrix
Actually I didn't even use Early Z *shocked*,
//Edit: or is it used by default, if I render with world.draw() ?
But I figured smth. out:
I rendered the sword in the overriden draw method of my player, if I render it in the "main" Render method (with RM_SOLID) it works all fine...
Any idea why this happens?
(This post was last modified: 12-08-2009 05:26 PM by Kevin.)
|
|
12-08-2009 05:22 PM |
|
Esenthel
Administrator
|
RE: Black rim in multipass
I don't understand, please post where exactly are you rendering? in what rendering modes, and with what matrixes?
(code would be nice)
|
|
12-08-2009 05:30 PM |
|
Kevin
Member
|
RE: Black rim in multipass
(12-08-2009 05:30 PM)Esenthel Wrote: I don't understand, please post where exactly are you rendering? in what rendering modes, and with what matrixes?
(code would be nice)
At the time I saw the black rim, I rendered in the player class (game::chr) in the draw method.
Code:
void draw()
{
__super::draw();
//... (draw armor)
OrientP& hand_r=cskel.getPoint("HandR");
Matrix m;
m.setPosDir(hand_r.pos,hand_r.perp,hand_r.dir);
Meshs("Obj/item/weapon/sword/0/0.mesh")->draw(m); // render item with matrix
}
Now the draw methode is called by Game::World.draw if I inserted the player in the world editor.
But now I changed the part, where the weapon is rendered, to this (moved into Main.cpp/Render):
Code:
void Render()
{
if(Kb.b(KB_I)) //wireframe
D.wire(true);
Game::World.draw();
D.wire(false);
switch(Renderer())
{
case RM_LIGHT:
LightDir(-!Vec(-1,1,1), Vec(0.45f)).add();
break;
case RM_SOLID:
OrientP& hand_r=player->cskel.getPoint("HandR");
Matrix m;
m.setPosDir(hand_r.pos,hand_r.perp,hand_r.dir);
Meshs("Obj/item/weapon/sword/0/0.mesh")->draw(m); // render item with matrix
break;
}
}
This method is called by Renderer(Render), in Draw!
So I think Game::World() did something with my sword internally which I didn't wanted... :-\
|
|
12-08-2009 06:17 PM |
|
Esenthel
Administrator
|
RE: Black rim in multipass
please notice that in the second codes you're rendering the sword only in RM_SOLID mode
while in first codes you render the mesh all the time (in all modes), please use switch(Renderer()) in the first codes too
|
|
12-08-2009 07:43 PM |
|
Kevin
Member
|
RE: Black rim in multipass
(12-08-2009 07:43 PM)Esenthel Wrote: please notice that in the second codes you're rendering the sword only in RM_SOLID mode
while in first codes you render the mesh all the time (in all modes), please use switch(Renderer()) in the first codes too
yeah, ok, I'll do, thank you!
|
|
12-08-2009 07:53 PM |
|