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
93
94
95
96
97
98
99
100
101
102
103
/*
Copyright (c) 2018 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 _ENVIRONMENT_PROBE_H_
#define _ENVIRONMENT_PROBE_H_

#include "Core/Math/BoundingVolumes/Headers/BoundingBox.h"
#include "Platform/Video/Buffers/RenderTarget/Headers/RenderTarget.h"

namespace Divide {

class Scene;
class GFXDevice;
class IMPrimitive;
class ShaderProgram;
class ImpostorSphere;

namespace GFX {
    class CommandBuffer;
}; //namespace GFX

FWD_DECLARE_MANAGED_CLASS(EnvironmentProbe);
class EnvironmentProbe : public GUIDWrapper {
public:
    enum class ProbeType {
        TYPE_INFINITE = 0,
        TYPE_LOCAL,
        COUNT
    };

public:
    EnvironmentProbe(Scene& parentScene, ProbeType type);
    ~EnvironmentProbe();

    static void onStartup(GFXDevice& context);
    static void onShutdown(GFXDevice& context);

    void refresh(GFX::CommandBuffer& bufferInOut);
    void setUpdateRate(U8 rate);
    void setBounds(const vec3<F32>& min, const vec3<F32>& max);
    void setBounds(const vec3<F32>& center, F32 radius);

    static RenderTargetHandle reflectionTarget();

    F32 distanceSqTo(const vec3<F32>& pos) const;
    U32 getRTIndex() const;

    void debugDraw(GFX::CommandBuffer& bufferInOut);

protected:
    void updateInternal();

    static U16 allocateSlice();

protected:
    ProbeType _type;
    U8 _updateRate;
    U8 _currentUpdateCall;
    U16 _currentArrayIndex;
    BoundingBox _aabb;
    IMPrimitive* _boundingBoxPrimitive;
    std::shared_ptr<ImpostorSphere> _impostor;
    std::shared_ptr<ShaderProgram> _impostorShader;

private:
    GFXDevice& _context;
    static vectorImpl<bool> s_availableSlices;
    static RenderTargetHandle s_reflection;
};

typedef vectorImpl<EnvironmentProbe_ptr> EnvironmentProbeList;

}; //namespace Divide

#endif //_ENVIRONMENT_PROBE_H_

Commits for Divide-Framework/trunk/Source Code/Rendering/Headers/EnvironmentProbe.h

Diff revisions: vs.
Revision Author Commited Message
1029 Diff Diff IonutCava picture IonutCava Tue 30 Jan, 2018 17:28:39 +0000

[Ionut]
- Update copyright notices

933 Diff Diff IonutCava picture IonutCava Tue 15 Aug, 2017 00:02:05 +0000

[Ionut]
- CommandBuffer Part 2/3: code compiles and splash screen renders and application doesn’t crash (still has drawing issues)

932 Diff Diff IonutCava picture IonutCava Mon 14 Aug, 2017 16:17:59 +0000

[Ionut]
- Transition every GPU call to the new GFX::CommandBuffer system.
- Part 1/3: Infrastructure. Does not compile yet; (ToDo: part 2/3: transition commands to new infrastructure. part 3/3: debug and optimize)

Currently supported commands:
BEGIN_RENDER_PASS
END_RENDER_PASS
BEGIN_RENDER_SUB_PASS
END_RENDER_SUB_PASS
SET_VIEWPORT
SET_SCISSOR
BIND_PIPELINE
BIND_DESCRIPTOR_SETS
SEND_PUSH_CONSTANTS
DRAW_COMMANDS
DRAW_TEXT
DISPATCH_COMPUTE

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

[IonutCava]
- Update copyright notice

815 Diff Diff IonutCava picture IonutCava Thu 12 Jan, 2017 23:33:01 +0000

[IonutCava]
- Fixed viewport alignment issue
- Added per-player RenderTargets (added index support to GFXRTPool)
- Initial implementation of per-player cameras
— Removed defaultCamera
— Scenes now use a baseCamera as a template for new player cameras

804 Diff Diff IonutCava picture IonutCava Thu 01 Dec, 2016 17:20:59 +0000

[IonutCava]
- Singleton elimination update Part I: get it to compile
— The following classes are no longer Singletons: GFXDevice, GL_API, DX_API, SFXWrapper, FmodWrapper, SDLWrapper, ALWrapper, PXDevice, InputInterface, RenderPassManager, SceneManager and ResourceManager;
— Refactor system to a Context / Component based implementation (Pass relevant context to objects: e.g. GFXDevice object to Textures, GUI to GUIElements, etc)
— Make devices and managers components of the kernel
— Allow multiple Resource caches to co-exist. This may prove useful for later when a more fragmented memory model is need (per frame / per scene / global caches / etc)

  • next steps: part II – cleanup/refactor new code, part III – optimise code, part IV – remove remaining Singletons (e.g. Application, ParamHandler, FrameListenerManager, Recast, PostFX and DebugInterface)
783 Diff Diff IonutCava picture IonutCava Fri 14 Oct, 2016 15:50:34 +0000

[IonutCava]
- More cleanup of the Frustum class
- Change random number generation system to use the C++11 <random> features. (default engine set to Mersenne Twister and using a uniform distribution as default)

777 Diff Diff IonutCava picture IonutCava Fri 07 Oct, 2016 16:14:48 +0000

[IonutCava]
- Continue to implement CommandBuffer / RenderPass / RenderSubPass system.
— Rendering artefacts are still present.

776 Diff Diff IonutCava picture IonutCava Thu 06 Oct, 2016 15:57:56 +0000

[IonutCava]
- Improve the CommandBuffer system to include the notion of a RenderPass /RenderSubPass with output render target info stored in them (not used yet)

768 IonutCava picture IonutCava Fri 09 Sep, 2016 14:38:51 +0000

[IonutCava]
- Refactored framework entry points (init, step, shutdown) to allow the addition of hot code reloading in the future