[C++] How to remove or skip Map shadow (for custom map)

Results 1 to 5 of 5
  1. #1
    Member vinleprince is offline
    MemberRank
    Feb 2015 Join Date
    77Posts

    [C++] How to remove or skip Map shadow (for custom map)

    for who don't know what that map shadow meaning. just skip this topic.


    few days ago. i just found some ace video. that server have custom map. but still have map shadow from original map that they clone. so i will give a guide to fix that SHIT.

    how this happen?
    when you clone dat. map that have shadow layer without remove.
    your new map will render that shadow and make your map look glitch.



    there have 2 solution here. just pick one
    1. create some app that can read dat structure then clean VERTEXINFO->nor from structure.
    2. skip map shadow render on client soruce.

    ProjectAtum\main\Background.cpp inside HRESULT CBackground::InitDeviceObjects()
    Code:
            memcpy(&m_pTileVertexArray[i], p, sizeof(VERTEXINFO));
            m_pTileVertexArray[i].nor = D3DXVECTOR3(0.0f,1.0f,0.0f); // Add this line
            p += sizeof(VERTEXINFO);


  2. #2
    [C++] How to remove or skip Map shadow (for custom map) St34lth4ng3l is offline
    MemberRank
    Apr 2013 Join Date
    __FILE__Location
    899Posts

    Re: [C++] How to remove or skip Map shadow (for custom map)

    Thats a complete new one for me aswell, didn't noticed it until your post here.
    Good one :D

  3. #3
    [C++] How to remove or skip Map shadow (for custom map) St34lth4ng3l is offline
    MemberRank
    Apr 2013 Join Date
    __FILE__Location
    899Posts

    Re: [C++] How to remove or skip Map shadow (for custom map)

    After getting a little hint from @Future it's not really a good idea to just simple zero out the vector, since it's a normal vector and that assumes that the terrain is completely flat.
    Check this for more info on normal vectors. The proper way to do it is to calculate them accordingly to your terrain mesh.
    You can do this during runtime or in your toolset (mapeditor) when saving the map.



    Unity as an example provides a method to get the normal vector so it's quite easy to use.

  4. #4
    Member vinleprince is offline
    MemberRank
    Feb 2015 Join Date
    77Posts

    Re: [C++] How to remove or skip Map shadow (for custom map)

    Quote Originally Posted by St34lth4ng3l View Post
    After getting a little hint from @Future it's not really a good idea to just simple zero out the vector, since it's a normal vector and that assumes that the terrain is completely flat.
    Check this for more info on normal vectors. The proper way to do it is to calculate them accordingly to your terrain mesh.
    You can do this during runtime or in your toolset (mapeditor) when saving the map.



    Unity as an example provides a method to get the normal vector so it's quite easy to use.

    thank for the hint,
    on the first that i found shadow vertex issue. i have no idea what nor work. but i try to check all nor vector. it seem to be store some vector every single map position x y. after i try to debug all nor. clean value seem to be 0,1,0
    so that’s why i didn’t looking to deeper. it should be make a little effect. but i dont know what it was.

  5. #5
    [C++] How to remove or skip Map shadow (for custom map) St34lth4ng3l is offline
    MemberRank
    Apr 2013 Join Date
    __FILE__Location
    899Posts

    Re: [C++] How to remove or skip Map shadow (for custom map)

    In theory it's quite easy to understand, it's just an arrow pointing in a 90° angle from the surface.
    But i failed vectors in school so i can't really provide more to this topic :D

    Here a little graphical example:

    Last edited by St34lth4ng3l; 09-07-21 at 12:22 AM. Reason: Better image



Advertisement