Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
   Copyright (c) 2017 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _SKY_H
#define _SKY_H

#include "Graphs/Headers/SceneNode.h"

namespace Divide {

class RenderStateBlock;

FWD_DECLARE_MANAGED_CLASS(Texture);
FWD_DECLARE_MANAGED_CLASS(Sphere3D);
FWD_DECLARE_MANAGED_CLASS(ShaderProgram);
FWD_DECLARE_MANAGED_CLASS(SceneGraphNode);

enum class RenderStage : U32;

class Sky : public SceneNode {
   public:
    explicit Sky(GFXDevice& context, ResourceCache& parentCache, size_t descriptorHash, const stringImpl& name, U32 diameter);
    ~Sky();

    bool onRender(const RenderStagePass& renderStagePass) override;
    void setSunProperties(const vec3<F32>& sunVect, const vec4<F32>& sunColour);

   protected:
    void postLoad(SceneGraphNode& sgn) override;

    void initialiseDrawCommands(SceneGraphNode& sgn,
                                const RenderStagePass& renderStagePass,
                                GenericDrawCommands& drawCommandsInOut) override;
    void updateDrawCommands(SceneGraphNode& sgn,
                            const RenderStagePass& renderStagePass,
                            const SceneRenderState& sceneRenderState,
                            GenericDrawCommands& drawCommandsInOut) override;

    void sceneUpdate(const U64 deltaTime,
                     SceneGraphNode& sgn,
                     SceneState& sceneState) override;
   protected:
    template <typename T>
    friend class ImplResourceLoader;

    bool load(const DELEGATE_CBK<void, CachedResource_wptr>& onLoadCallback) override;

  private:
    U32       _diameter;
    GFXDevice& _context;
    Texture_ptr  _skybox;
    Sphere3D_ptr _sky;
    ShaderProgram_ptr _skyShader;
    ShaderProgram_ptr _skyShaderPrePass;
    size_t _skyboxRenderStateHash;
    size_t _skyboxRenderStateHashPrePass;
    size_t _skyboxRenderStateReflectedHash;
};

TYPEDEF_SMART_POINTERS_FOR_CLASS(Sky);

};  // namespace Divide

#endif

Commits for Divide-Framework/trunk/Source Code/Environment/Sky/Headers/Sky.h

Diff revisions: vs.
Revision Author Commited Message
893 Diff Diff IonutCava picture IonutCava Sun 18 Jun, 2017 17:33:07 +0000

[Ionut]
- Initial implementation of a PipelineStateObject (holds shader program, rasterizer state, etc)
- Rework PCH implementation a bit because VS2017 no longer has a /ZM option

877 Diff Diff IonutCava picture IonutCava Thu 16 Mar, 2017 21:55:59 +0000

[IonutCava]
- Reflection updates
- Sky parallax fixes
- Initial support for Tessellation patches (used by the new terrain system – W.I.P.)

863 Diff Diff IonutCava picture IonutCava Wed 15 Feb, 2017 16:27:26 +0000

[IonutCava]
- Split Resource class into Resource and CachedResource
— CachedResource is the only resource held in a ResourceCache and loaded from a ResourceDescriptor
— CachedResource is mapped by its creation descriptor’s hash value, instead of the resource name
-— Multiple cached resources can now exist with the same name if the have different properties, for example.

860 Diff Diff IonutCava picture IonutCava Mon 13 Feb, 2017 21:07:59 +0000

[IonutCava]
- Fix shared_ptr leak in resource loading callbacks

858 Diff Diff IonutCava picture IonutCava Sun 12 Feb, 2017 20:55:05 +0000

[IonutCava]
- More resource loading updates

856 Diff Diff IonutCava picture IonutCava Fri 10 Feb, 2017 17:19:06 +0000

[IonutCava]
- Attempt to improve resource creation mechanism by adding a callback for when the resource finishes loading
— This is useful for multi-threaded loading: shaders, textures, terrain, etc

852 Diff Diff IonutCava picture IonutCava Tue 07 Feb, 2017 17:17:27 +0000

[IonutCava]
- Separate Pass Type from Render Stage:
— Render Stage: Display, Shadow, Reflection, Refraction, etc
— Pass Type: Depth pass, Colour Pass, etc
- ToDo: Bug fixes for issues introduced with this change

851 Diff Diff IonutCava picture IonutCava Mon 06 Feb, 2017 23:38:14 +0000

[IonutCava]
- Replaced most RenderStage params with RenderStagePass types
- More work on water rendering

836 Diff Diff IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice

821 IonutCava picture IonutCava Tue 17 Jan, 2017 17:15:45 +0000

[IonutCava]
- Profile guided optimizations