ensiform Posted December 10, 2014 Posted December 10, 2014 I don't see the shadows showing up at all for the misc_model_static or misc_model_ghoul. RF_NOSHADOW prohibits shadow generation in engine (cg_shadows > 1 )
Tempust85 Posted December 10, 2014 Author Posted December 10, 2014 I know, I've enabled shadows on misc_model_static. It's just the origin is wrong for some reason for it and misc_model_ghoul.
ensiform Posted December 10, 2014 Posted December 10, 2014 Probably need the lightningorigin in the refent.
Tempust85 Posted December 11, 2014 Author Posted December 11, 2014 I've tried using centity renderfx rf_lighting_origin but it changed nothing. I'll try refent. I'm guessing the origin issue is why the misc static & ghoul aren't displaying stencil shadows in certain areas in a map when the player + NPCs do.
Tempust85 Posted December 11, 2014 Author Posted December 11, 2014 I decided to play with the ground distance "fudge" factor for stencil shadows and..........
Archangel35757 Posted December 11, 2014 Posted December 11, 2014 Getting there... maybe you could share your code snippet for misc_model_ghoul with @@ensiform and/or @@Xycaleth... so they can help find the source of the problem (pun intended).
Tempust85 Posted December 11, 2014 Author Posted December 11, 2014 It's fixed. It works just as if it were an NPC or the player model. Now there's just finding a way to disable those shitty looking self shadows on the models. It has the standard shading + stencil shading.
ensiform Posted December 11, 2014 Posted December 11, 2014 I've tried using centity renderfx rf_lighting_origin but it changed nothing. I'll try refent. I'm guessing the origin issue is why the misc static & ghoul aren't displaying stencil shadows in certain areas in a map when the player + NPCs do.Simply setting the flag doesn't do anything, you must actually supply the lightning origin information in the struct as well. Tempust85 likes this
Archangel35757 Posted December 11, 2014 Posted December 11, 2014 Are the poor shadows you're referring to the very aliased shadow cast on the ground by the left star-fighter? Or the backside of Kyle? Is there anyway to run a Gaussian Blur and an AA filter on the aliased star-fighter shadow so it's not so blocky?
Tempust85 Posted December 11, 2014 Author Posted December 11, 2014 The shadows on the model, not the projected shadows on the ground. I'm sure there's ways to blur them, but I certainly wouldn't know how though if I were to take a guess it would be where it does the shadow edges.
Archangel35757 Posted December 17, 2014 Posted December 17, 2014 @@DT85 Can ragdoll physics be turned on and used for misc_model_ghoul?
Tempust85 Posted December 17, 2014 Author Posted December 17, 2014 No, and no idea how exactly you'd enable it for alive models.
Archangel35757 Posted December 18, 2014 Posted December 18, 2014 Will the player be able to interact with a misc_model_ghoul (MMG)? I mean... suppose you use this to spawn (can you spawn an MMG?) a dead corpse (to replace the dead NPC at the moment its corpse disappears...) Then passing NPC's see static corpse and go into alert mode? Or player could walk up to static corpse and be prompted to "Pick up corpse" so you have to hide the body-- which would trigger a new anim to play on MMg corpse being carried etc.
Tempust85 Posted December 18, 2014 Author Posted December 18, 2014 No. Consider it an animated, ghoul2 version of misc_model_static.
Tempust85 Posted October 28, 2016 Author Posted October 28, 2016 Necro time! New features: - render radius- rootbone LOOP - Loop the animation. Default - play once. "model" - arbitrary .glm file to load "modelscale" - "x" uniform scale "modelscale_vec" - "x y z" scale model in each axis "renderRadius" - default "120" model render radius "rootbone" - default "model_root" animation root bone "startframe" - default "0". animation start frame "endframe" - default "0". animation end frame "skin" default "models/players/kyle/model_default.skin" - skin file to load. must include path. - The frames between the "startframe" & "endframe" will play. - Use "renderRadius" for models larger than a player if you notice them disappearing when moving the camera. - Use "rootbone" if wanting to change the root bone that the animation will play from. Now whenever I have 3x Kyles animating in a very small basic test map, my FPS dips from 60 to 49 unless I look away. Something I've missed or done wrong perhaps...... @@Xycaleth @@ensiform @@eezstreet Would I need to precache it? void SP_misc_model_ghoul( gentity_t *ent ) { #if 1 ent->s.modelindex = G_ModelIndex( ent->model ); gi.G2API_InitGhoul2Model(ent->ghoul2, ent->model, ent->s.modelindex, NULL_HANDLE, NULL_HANDLE, 0, 0); //DT EDIT: misc_model_ghoul edits - START //ent->s.radius = 50; if (ent->playerModel >= 0) { ent->rootBone = gi.G2API_GetBoneIndex(&ent->ghoul2[ent->playerModel], "model_root", qtrue); } G_SpawnInt("renderRadius", "120", &ent->s.radius); //DT EDIT: misc_model_ghoul edits - END G_SetOrigin( ent, ent->s.origin ); G_SetAngles( ent, ent->s.angles ); qboolean bHasScale = G_SpawnVector( "modelscale_vec", "1 1 1", ent->s.modelScale ); if ( !bHasScale ) { float temp; G_SpawnFloat( "modelscale", "0", &temp ); if ( temp != 0.0f ) { ent->s.modelScale[0] = ent->s.modelScale[1] = ent->s.modelScale[2] = temp; bHasScale = qtrue; } } if ( bHasScale ) { //scale the x axis of the bbox up. ent->maxs[0] *= ent->s.modelScale[0]; ent->mins[0] *= ent->s.modelScale[0]; //scale the y axis of the bbox up. ent->maxs[1] *= ent->s.modelScale[1]; ent->mins[1] *= ent->s.modelScale[1]; //scale the z axis of the bbox up and adjust origin accordingly ent->maxs[2] *= ent->s.modelScale[2]; float oldMins2 = ent->mins[2]; ent->mins[2] *= ent->s.modelScale[2]; ent->s.origin[2] += (oldMins2 - ent->mins[2]); } //DT EDIT: misc_model_ghoul edits - START G_SpawnInt("startframe", "0", &ent->startFrame); G_SpawnInt("endframe", "0", &ent->endFrame); char *root_boneName;//[MAX_QPATH]; G_SpawnString("rootbone", "model_root", &root_boneName); gi.G2API_SetBoneAnim(&ent->ghoul2[0], root_boneName, ent->startFrame, ent->endFrame, BONE_ANIM_OVERRIDE_LOOP, 1.0f + Q_flrand(-1.0f, 1.0f) * 0.1f, 0, -1, -1); ent->endFrame = 0; // don't allow it to do anything with the animation function in G_main char *skinName;//[MAX_QPATH]; int skin = gi.RE_RegisterSkin(skinName); G_SpawnString("skin", "models/players/kyle/model_default.skin", &skinName); gi.G2API_SetSkin(&ent->ghoul2[ent->playerModel], G_SkinIndex(skinName), skin); //DT EDIT: misc_model_ghoul edits - END gi.linkentity (ent); #else
eezstreet Posted October 28, 2016 Posted October 28, 2016 Not sure. My guess is soemthing is being called every frame that shouldn't be.
Tempust85 Posted October 28, 2016 Author Posted October 28, 2016 Had a look at other ghoul2 stuff and came across this: gi.G2API_PrecacheGhoul2Model(Model); So I just added it to the end of misc_model_ghoul and the FPS appears to be staying at 60 now. I wonder if this is was the issue all along or not, so I'd like some feedback. Archangel35757 likes this
Tempust85 Posted October 30, 2016 Author Posted October 30, 2016 No one else besides eezstreet chiming in? Well, I certainly hope that was the fix.
Archangel35757 Posted October 30, 2016 Posted October 30, 2016 If the frame rates are consistent now, I'd say you fixed it! Great work! You should submit it as a pull request back to OpenJK (...of course you'll need to apply your fixes to a recent version of OpenJK). Then the other coders will have to look at it-- to approve it. Tempust85 likes this
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now