About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Point Light problem
Author Message
Zervox Offline
Silver Supporter

Post: #1
Point Light problem
Inside Esenthel Editor
   
Inside Game
   

:Note the top wall inside the room is still affected by the point light.
Lights in the hallways are cone lights just to clear up confusion about them.

I am not sure if this code relates to the problem I am having.
Code:
enum OBJ_TYPE // Game Object Class Types
{
    OBJ_ITEM,
    OBJ_LIGHT_POINT,
    OBJ_LIGHT_CONE,
    OBJ_NPC,
    OBJ_PARTICLES,
    OBJ_PLR,
    OBJ_STATIC,
};

static void EE_INIT_OBJ_TYPE() // this function will setup Game.ObjType enum used for game object types
{
    Enum::Elm elms[] = // list of Editor created Object Classes
    {
        { "OBJ_ITEM", UID(1347336143, 1270230391, 3653824415, 3844916636) },
        { "OBJ_LIGHT_CONE", UID(709738609, 1283377030, 1278605192, 1043969849) },
        { "OBJ_LIGHT_POINT", UID(4269707979, 1188118206, 2418686103, 1094474670) },
        { "OBJ_NPC", UID(4021019988, 1148616729, 3251781561, 3088074454) },
        { "OBJ_PARTICLES", UID(2721776529, 1227196451, 2852647815, 3333460217) },
        { "OBJ_PLR", UID(2596146441, 1208512423, 2416666765, 612060196) },
        { "OBJ_STATIC", UID(3286429030, 1107381719, 3827384999, 1409372846) },
        
    };
    Game::ObjType.create(L"OBJ_TYPE", elms); // create Game.ObjType enum
}
(This post was last modified: 09-15-2014 02:18 PM by Zervox.)
09-15-2014 02:17 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #2
RE: Point Light problem
When i tried to make them appear in the game i had to add

this at the beginning:
Code:
Game.ObjMap<Game.ObjLightPoint > Lightpionts;  // container for lightpoints

And this at init function:
Code:
Game.World.setObjType(Lightpionts, OBJ_LIGHT_POINT);
09-15-2014 04:12 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #3
RE: Point Light problem
as I commented, the top wall of the room gets lightened from the point light in the roof, I can't figure out why it won't light the room at the same strength, nor does it seem to light the lower half of the room at all. :|
(This post was last modified: 09-15-2014 04:30 PM by Zervox.)
09-15-2014 04:26 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #4
RE: Point Light problem
Quote::Note the top wall inside the room is still affected by the point light.
Just don't get where is it smile

Just for test purposes try to change power and color of the point

Code:
REPA(Lightpionts)
{
    Lightpionts[i].range = 15;
    Lightpionts[i].color = Vec(1);        
}

By the way do you draw them in RM_PREPARE mode?
(This post was last modified: 09-15-2014 04:37 PM by Houge.)
09-15-2014 04:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #5
RE: Point Light problem
/Facepalm

Seems I pasted the UIDs wronggrin

Still getting used to using UIDs for things as I've long used my own world manager and/or Esenthel 1.0 legacy code for a long time. wink


Oh by the way, Game::World.draw() is all you need to call and all your Game.objmap<> types should be drawn for you, same goes for update.
(This post was last modified: 09-15-2014 05:35 PM by Zervox.)
09-15-2014 05:27 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #6
RE: Point Light problem
Good that the problem is solved!
By the way thanks for suggestion!

EDIT:
Game::World.draw() is all you need to call

Doesn't work for me smile
(This post was last modified: 09-15-2014 05:48 PM by Houge.)
09-15-2014 05:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply