3D rendering in 5.x... what happened? menu

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Thomja's Avatar Almost Legendary User
    Reputation
    538
    Join Date
    Nov 2008
    Posts
    639
    Thanks G/R
    14/38
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DarkLinux is the shit. I bet he could do some really nice hacks for WoW and even sell them. I do not know much about C++ and I am to lazy to get into it aswell. I'd love to help administrating a hack if he made it! Hes last public hack had a great looking GUI aswell.

    3D rendering in 5.x... what happened?
  2. #17
    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)
    Originally Posted by _Mike View Post
    Doesn't work at all for me. stuff is behind everything.
    Care to explain how you did this exactly ?

    Edit: Actually it's not really behind everything but draws as if the Near / FarClip values would be incorrect when they aren't.
    Edit2: Viewport MaxZ is different in EndScene than in the function I used to draw in, fixed it. Problem is it overlaps Interface :C
    Last edited by Master674; 10-03-2012 at 02:06 PM.

  3. #18
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Master674 View Post
    Doesn't work at all for me. stuff is behind everything.
    Care to explain how you did this exactly ?

    Edit: Actually it's not really behind everything but draws as if the Near / FarClip values would be incorrect when they aren't.
    Edit2: Viewport MaxZ is different in EndScene than in the function I used to draw in, fixed it. Problem is it overlaps Interface :C
    Code:
    Device.SetTransform(TransformState.World, Matrix.Translation(myPos.X, myPos.Y, myPos.Z));
    
    
    
                    ColoredVertex[] triangleVerts = new[]
                        {
                            new ColoredVertex(new Vector3(0f, 0f, 5f), Color.Red.ToArgb()),
                            new ColoredVertex(new Vector3(5f, -5f, 0f), Color.Blue.ToArgb()),
                            new ColoredVertex(new Vector3(-5f, 5f, 0f), Color.Green.ToArgb())
                        };
    
    
                    var vp = Device.Viewport;
                    vp.MinZ = 0f;
                    vp.MaxZ = 0.94f;
                    Device.Viewport = vp;
    
    
                    var oldDecl = Device.VertexDeclaration;
    
    
                    Device.VertexDeclaration = ColoredVertex.GetDecl(Device);
                    
                    Device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, triangleVerts);
    
    
                    Device.VertexDeclaration = oldDecl;
    This is being called from EndScene.

    Code:
                Device.SetTransform(TransformState.View, View);
                Device.SetTransform(TransformState.Projection, Projection);
                Device.SetTransform(TransformState.World, Matrix.Identity);
    
    
                Device.VertexShader = null;
                Device.PixelShader = null;
                
                //// Required to enabled 3D drawing
                Device.SetRenderState(RenderState.ColorWriteEnable, ColorWriteEnable.All);
    
    
                //// Lighting / Alpha Stuff
                Device.SetRenderState(RenderState.Lighting, false);
    
    
    
    
                Device.SetRenderState(RenderState.CullMode, Cull.None);
                Device.SetRenderState(RenderState.AlphaBlendEnable, true);
                Device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
                Device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
    
    
                // Depth
                Device.SetRenderState(RenderState.ZEnable, true);
                Device.SetRenderState(RenderState.ZWriteEnable, true);
                Device.SetRenderState(RenderState.ZFunc, Compare.LessEqual);
    
    
                Device.SetTextureStageState(0, TextureStage.ColorOperation, TextureOperation.Disable);
                Device.SetTextureStageState(0, TextureStage.AlphaOperation, TextureOperation.Disable);
                Device.SetTextureStageState(0, TextureStage.ColorArg2, TextureArgument.Texture);

  4. #19
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    @_Mike
    Is that really from EndScene?
    Yes. If your depth testing isn't working your nearclip/farclip or your viewport is wrong.
    0xAEBC90 - float World::GetNearClip() // 16057, default base
    0xAEBC50 - float World::GetFarClip()
    See Apoc's post for the viewport.

    Originally Posted by Master674 View Post
    Problem is it overlaps Interface :C
    Yeah I have the same problem. I guess I could hook CWorldSceneRender::Render like you do but I would prefer to keep my code as non game specific as possible. And sometimes I'd actually want to draw above the interface which I assume is not possible from that function, and then I'd need 2 hooks.

  5. #20
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by _Mike View Post
    Yes. If your depth testing isn't working your nearclip/farclip or your viewport is wrong.
    0xAEBC90 - float World::GetNearClip() // 16057, default base
    0xAEBC50 - float World::GetFarClip()
    See Apoc's post for the viewport.


    Yeah I have the same problem. I guess I could hook CWorldSceneRender::Render like you do but I would prefer to keep my code as non game specific as possible. And sometimes I'd actually want to draw above the interface which I assume is not possible from that function, and then I'd need 2 hooks.
    I don't think there's much of an issue with drawing above the UI. You could hook the func that does *all* the drawing, but where's the fun in that?

  6. #21
    asdcxy's Avatar Corporal
    Reputation
    6
    Join Date
    Oct 2012
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what's the current layout of the camera struct?

    long time ago it was
    struct SCameraInfo
    {
    DWORD dwFoo1[2]; // 00
    float fPos[3]; // 02
    float fViewMat[3][3]; // 05
    float zNearPlane; // 14
    float zFarPlane; // 15
    float fFov; //16
    float aspect; // 17
    };

    then in another thread i found
    public struct CameraInfo
    {
    uint unk0;
    uint unk1;
    public Vector3 Position;
    public Matrix3 Matrix;
    public float FieldOfView;
    float unk2;
    int unk3;
    public float NearZ;
    public float FarZ;
    public float Aspect;
    }

    but this also doesn't seem to be ok
    position, view matrix and fov seem to be ok (fov 1.57 is (2*pi)/4 so this should be right)
    but for the adress of nearz, farz and ascpect i only get 0

Page 2 of 2 FirstFirst 12

Similar Threads

  1. What happened to the speech files?
    By Rickye in forum World of Warcraft General
    Replies: 2
    Last Post: 12-28-2006, 12:26 AM
  2. Gack! What happened?
    By Lukargo in forum World of Warcraft General
    Replies: 3
    Last Post: 12-24-2006, 09:49 AM
  3. This is what happens when....
    By TwiceoveR in forum World of Warcraft General
    Replies: 3
    Last Post: 12-20-2006, 02:44 PM
  4. What happened to "on top of if bank"? thread
    By phanice in forum World of Warcraft General
    Replies: 0
    Last Post: 10-25-2006, 12:43 AM
  5. What happened?
    By janzi9 in forum OC News
    Replies: 15
    Last Post: 05-30-2006, 07:28 PM
All times are GMT -5. The time now is 10:08 AM. 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