[Question] Drawing in game? menu

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah right... you have to adjust the viewport.
    Code:
            private void PrepareRenderState()
            {
                var viewport = _device.Viewport;
                viewport.MinZ = 0.0f;
                viewport.MaxZ = 0.94f;
                _device.Viewport = viewport;
                _device.VertexShader = null;
                _device.PixelShader = null;
                _device.SetRenderState(RenderState.ZEnable, true);
                _device.SetRenderState(RenderState.ZWriteEnable, true);
                _device.SetRenderState(RenderState.ZFunc, Compare.LessEqual);
                _device.SetRenderState(RenderState.AlphaBlendEnable, true);
                _device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
                _device.SetRenderState(RenderState.Lighting, false);
                _device.SetTexture(0, null);
                _device.SetRenderState(RenderState.CullMode, Cull.None);
            }
    Note that some settings are redundant or optional for rendering to work... but you definitely should not need more than those.
    Last edited by Bananenbrot; 08-18-2012 at 02:17 AM.

    [Question] Drawing in game?
  2. #17
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still have issues.

    When I render with NearZ/FarZ as normal I don't see anything.

    Tired to swap NearZ/FarZ as Master suggested and the result is below -.-

    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  3. #18
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you check your projection matrix for correctness?

  4. #19
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Bananenbrot View Post
    Did you check your projection matrix for correctness?
    Thanks +Rep x 4
    Last edited by -Ryuk-; 08-18-2012 at 07:53 AM.
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  5. #20
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <something used to be here... its gone now>
    Last edited by Master674; 10-15-2012 at 12:49 PM.

  6. #21
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually you should read out at least the farclip value... it's different depending on where you are. It was the same thing Ryuk got wrong. Look into base + 0x3222D0 (float __cdecl World::GetFarClip()). If you don't want to use the function, read the value which is first moved into xmm0.
    If you don't use those values, you get z-buffer issues like Ryuk, who had Camera.NearZ and Camera.FarZ for clipping (0 and 1), which are actually for the viewport.

  7. #22
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great information Bananenbrot!

  8. #23
    kingdeking's Avatar Member
    Reputation
    4
    Join Date
    Oct 2008
    Posts
    50
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Orcs have lasas now ??? Uhhaaaaaaa

  9. #24
    Kalle200000's Avatar Member
    Reputation
    1
    Join Date
    Jul 2008
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is awesome that you guys keep this forumsection alive. Impressive work!

  10. #25
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Thanks to boredevil !!



    Thanks Bananenbrot! Boredevil used a SetViewport hook, but object flashed. This will help me fix that problem +4 Rep
    Last edited by DarkLinux; 08-21-2012 at 10:30 PM.

  11. #26
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I tried that, it would not render under certain circumstances. IIRC it won't render (or at least incorrectly) when in a building because there are less/more render calls.
    Also setting near and far clip to a fixed value like 1600 will result in zbuffer errors. For example, if the actual farclip value used by wow is 800, things that are at about 1500 yards "away" from the camera could be rendered before wow's stuff that's at 700 yards.
    Don't nail me on this, because zbuffer values are normally logarithmically or reziprocal distributed in regards to the distance as opposed to linear... But you already can see it if you render triangles in every object. The triangle will seem to be slightly in front of them from every point of view.

  12. #27
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For anyone wondering what to hook in recent versions: 0x00B40DB0 (relative to 0x400000, 5.1 16357) is a simple thiscall which is usable for rendering behind the UI including alpha checks. Just remember that you need to additionaly throw in ColorWriteEnable with all 4 flags set.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Question] Drawing Dots in Colors on GUI
    By d3rrial in forum Programming
    Replies: 0
    Last Post: 09-28-2010, 02:12 PM
  2. Question about cracking games\applications in general.
    By deafrow in forum Community Chat
    Replies: 2
    Last Post: 03-03-2010, 01:23 PM
  3. [Question] Best in game guide?
    By JakezShadow in forum World of Warcraft General
    Replies: 8
    Last Post: 01-17-2009, 10:16 PM
  4. Question on custom Game Objects
    By spc4101 in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 07-05-2008, 04:19 PM
All times are GMT -5. The time now is 04:32 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search