From 4ff080d0d125fc192ad100ae6fad153a79615846 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 6 Dec 2004 19:33:57 +0000 Subject: [PATCH] remove old stale code --- panda/src/ribdisplay/Sources.pp | 21 - panda/src/ribdisplay/config_ribdisplay.cxx | 35 - panda/src/ribdisplay/config_ribdisplay.h | 27 - panda/src/ribdisplay/ribGraphicsPipe.I | 70 - panda/src/ribdisplay/ribGraphicsPipe.cxx | 59 - panda/src/ribdisplay/ribGraphicsPipe.h | 73 - panda/src/ribdisplay/ribGraphicsWindow.I | 177 --- panda/src/ribdisplay/ribGraphicsWindow.cxx | 411 ------ panda/src/ribdisplay/ribGraphicsWindow.h | 147 -- panda/src/ribgsg/Sources.pp | 20 - panda/src/ribgsg/config_ribgsg.cxx | 32 - panda/src/ribgsg/config_ribgsg.h | 27 - panda/src/ribgsg/ribGraphicsStateGuardian.I | 17 - panda/src/ribgsg/ribGraphicsStateGuardian.cxx | 1242 ----------------- panda/src/ribgsg/ribGraphicsStateGuardian.h | 182 --- panda/src/ribgsg/ribStuffTraverser.cxx | 52 - panda/src/ribgsg/ribStuffTraverser.h | 48 - panda/src/shader/Sources.pp | 37 - panda/src/shader/casterShader.I | 41 - panda/src/shader/casterShader.cxx | 23 - panda/src/shader/casterShader.h | 79 -- panda/src/shader/config_shader.cxx | 68 - panda/src/shader/config_shader.h | 27 - panda/src/shader/outlineShader.cxx | 110 -- panda/src/shader/outlineShader.h | 70 - panda/src/shader/planarReflector.cxx | 360 ----- panda/src/shader/planarReflector.h | 94 -- panda/src/shader/projtexShader.cxx | 154 -- panda/src/shader/projtexShader.h | 72 - panda/src/shader/projtexShadower.cxx | 259 ---- panda/src/shader/projtexShadower.h | 88 -- panda/src/shader/shader.I | 61 - panda/src/shader/shader.cxx | 120 -- panda/src/shader/shader.h | 153 -- panda/src/shader/shaderTransition.I | 80 -- panda/src/shader/shaderTransition.cxx | 323 ----- panda/src/shader/shaderTransition.h | 122 -- panda/src/shader/shader_composite1.cxx | 7 - panda/src/shader/shader_composite2.cxx | 8 - panda/src/shader/spheretexHighlighter.cxx | 185 --- panda/src/shader/spheretexHighlighter.h | 87 -- panda/src/shader/spheretexReflector.cxx | 234 ---- panda/src/shader/spheretexReflector.h | 99 -- panda/src/shader/spheretexShader.cxx | 131 -- panda/src/shader/spheretexShader.h | 84 -- panda/src/shader/spotlightShader.cxx | 76 - panda/src/shader/spotlightShader.h | 67 - panda/src/testbed/downloader_test.cxx | 84 -- panda/src/testbed/herc.cxx | 530 ------- panda/src/testbed/indirect.cxx | 173 --- panda/src/testbed/loader_test.cxx | 68 - panda/src/testbed/min_herc.cxx | 444 ------ panda/src/testbed/min_shader.cxx | 823 ----------- panda/src/testbed/motion.cxx | 126 -- panda/src/testbed/open_window.cxx | 150 -- panda/src/testbed/rock-floor.rgb | Bin 99161 -> 0 bytes panda/src/testbed/shader_test.cxx | 721 ---------- panda/src/testbed/test_eggWrite.cxx | 112 -- panda/src/testbed/test_recparticles.cxx | 163 --- panda/src/testbed/test_sprite_particles.cxx | 308 ---- panda/src/testbed/vrpn_demo.cxx | 66 - 61 files changed, 9727 deletions(-) delete mode 100644 panda/src/ribdisplay/Sources.pp delete mode 100644 panda/src/ribdisplay/config_ribdisplay.cxx delete mode 100644 panda/src/ribdisplay/config_ribdisplay.h delete mode 100644 panda/src/ribdisplay/ribGraphicsPipe.I delete mode 100644 panda/src/ribdisplay/ribGraphicsPipe.cxx delete mode 100644 panda/src/ribdisplay/ribGraphicsPipe.h delete mode 100644 panda/src/ribdisplay/ribGraphicsWindow.I delete mode 100644 panda/src/ribdisplay/ribGraphicsWindow.cxx delete mode 100644 panda/src/ribdisplay/ribGraphicsWindow.h delete mode 100644 panda/src/ribgsg/Sources.pp delete mode 100644 panda/src/ribgsg/config_ribgsg.cxx delete mode 100644 panda/src/ribgsg/config_ribgsg.h delete mode 100644 panda/src/ribgsg/ribGraphicsStateGuardian.I delete mode 100644 panda/src/ribgsg/ribGraphicsStateGuardian.cxx delete mode 100644 panda/src/ribgsg/ribGraphicsStateGuardian.h delete mode 100644 panda/src/ribgsg/ribStuffTraverser.cxx delete mode 100644 panda/src/ribgsg/ribStuffTraverser.h delete mode 100644 panda/src/shader/Sources.pp delete mode 100644 panda/src/shader/casterShader.I delete mode 100644 panda/src/shader/casterShader.cxx delete mode 100644 panda/src/shader/casterShader.h delete mode 100644 panda/src/shader/config_shader.cxx delete mode 100644 panda/src/shader/config_shader.h delete mode 100644 panda/src/shader/outlineShader.cxx delete mode 100644 panda/src/shader/outlineShader.h delete mode 100644 panda/src/shader/planarReflector.cxx delete mode 100644 panda/src/shader/planarReflector.h delete mode 100644 panda/src/shader/projtexShader.cxx delete mode 100644 panda/src/shader/projtexShader.h delete mode 100644 panda/src/shader/projtexShadower.cxx delete mode 100644 panda/src/shader/projtexShadower.h delete mode 100644 panda/src/shader/shader.I delete mode 100644 panda/src/shader/shader.cxx delete mode 100644 panda/src/shader/shader.h delete mode 100644 panda/src/shader/shaderTransition.I delete mode 100644 panda/src/shader/shaderTransition.cxx delete mode 100644 panda/src/shader/shaderTransition.h delete mode 100644 panda/src/shader/shader_composite1.cxx delete mode 100644 panda/src/shader/shader_composite2.cxx delete mode 100644 panda/src/shader/spheretexHighlighter.cxx delete mode 100644 panda/src/shader/spheretexHighlighter.h delete mode 100644 panda/src/shader/spheretexReflector.cxx delete mode 100644 panda/src/shader/spheretexReflector.h delete mode 100644 panda/src/shader/spheretexShader.cxx delete mode 100644 panda/src/shader/spheretexShader.h delete mode 100644 panda/src/shader/spotlightShader.cxx delete mode 100644 panda/src/shader/spotlightShader.h delete mode 100644 panda/src/testbed/downloader_test.cxx delete mode 100644 panda/src/testbed/herc.cxx delete mode 100644 panda/src/testbed/indirect.cxx delete mode 100644 panda/src/testbed/loader_test.cxx delete mode 100644 panda/src/testbed/min_herc.cxx delete mode 100644 panda/src/testbed/min_shader.cxx delete mode 100644 panda/src/testbed/motion.cxx delete mode 100644 panda/src/testbed/open_window.cxx delete mode 100644 panda/src/testbed/rock-floor.rgb delete mode 100644 panda/src/testbed/shader_test.cxx delete mode 100644 panda/src/testbed/test_eggWrite.cxx delete mode 100644 panda/src/testbed/test_recparticles.cxx delete mode 100644 panda/src/testbed/test_sprite_particles.cxx delete mode 100644 panda/src/testbed/vrpn_demo.cxx diff --git a/panda/src/ribdisplay/Sources.pp b/panda/src/ribdisplay/Sources.pp deleted file mode 100644 index a010b83366..0000000000 --- a/panda/src/ribdisplay/Sources.pp +++ /dev/null @@ -1,21 +0,0 @@ -#define BUILD_DIRECTORY $[HAVE_RIB] - -#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \ - dtoolutil:c dtoolbase:c dtool:m - -#begin lib_target - #define TARGET ribdisplay - #define LOCAL_LIBS \ - display ribgsg - - #define SOURCES \ - config_ribdisplay.cxx config_ribdisplay.h ribGraphicsPipe.I \ - ribGraphicsPipe.cxx ribGraphicsPipe.h ribGraphicsWindow.I \ - ribGraphicsWindow.cxx ribGraphicsWindow.h - - #define INSTALL_HEADERS \ - ribGraphicsPipe.I ribGraphicsPipe.h ribGraphicsWindow.I \ - ribGraphicsWindow.h - -#end lib_target - diff --git a/panda/src/ribdisplay/config_ribdisplay.cxx b/panda/src/ribdisplay/config_ribdisplay.cxx deleted file mode 100644 index 9fa9e8d5a6..0000000000 --- a/panda/src/ribdisplay/config_ribdisplay.cxx +++ /dev/null @@ -1,35 +0,0 @@ -// Filename: config_ribdisplay.cxx -// Created by: cary (07Oct99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "config_ribdisplay.h" -#include "ribGraphicsPipe.h" -#include "ribGraphicsWindow.h" - -#include "dconfig.h" - -Configure(config_ribdisplay); -NotifyCategoryDef(ribdisplay, "display"); - -ConfigureFn(config_ribdisplay) { - RIBGraphicsPipe::init_type(); - GraphicsPipe::get_factory().register_factory(RIBGraphicsPipe::get_class_type(), - RIBGraphicsPipe::make_RIBGraphicsPipe); - RIBGraphicsWindow::init_type(); - GraphicsWindow::get_factory().register_factory(RIBGraphicsWindow::get_class_type(), - RIBGraphicsWindow::make_RibGraphicsWindow); -} diff --git a/panda/src/ribdisplay/config_ribdisplay.h b/panda/src/ribdisplay/config_ribdisplay.h deleted file mode 100644 index d9f639ecea..0000000000 --- a/panda/src/ribdisplay/config_ribdisplay.h +++ /dev/null @@ -1,27 +0,0 @@ -// Filename: config_ribdisplay.h -// Created by: cary (07Oct99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef CONFIG_RIBDISPLAY_H -#define CONFIG_RIBDISPLAY_H - -#include "pandabase.h" -#include "notifyCategoryProxy.h" - -NotifyCategoryDecl(ribdisplay, EXPCL_PANDARIB, EXPTP_PANDARIB); - -#endif diff --git a/panda/src/ribdisplay/ribGraphicsPipe.I b/panda/src/ribdisplay/ribGraphicsPipe.I deleted file mode 100644 index 8495d75bb9..0000000000 --- a/panda/src/ribdisplay/ribGraphicsPipe.I +++ /dev/null @@ -1,70 +0,0 @@ -// Filename: ribGraphicsPipe.I -// Created by: drose (17Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsPipe::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE RIBGraphicsPipe:: -RIBGraphicsPipe(const PipeSpecifier& spec) - : NoninteractiveGraphicsPipe(spec), _filename(spec.get_file_name()) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsPipe::get_file_name -// Access: Public -// Description: gets the base filename -//////////////////////////////////////////////////////////////////// -INLINE std::string RIBGraphicsPipe:: -get_file_name(void) const { - return _filename; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsPipe::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE RIBGraphicsPipe:: -RIBGraphicsPipe(void) { - cerr << "RIBGraphicsPipes should not be created with default constructor" - << endl; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsPipe::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE RIBGraphicsPipe:: -RIBGraphicsPipe(const RIBGraphicsPipe&) { - cerr << "RIBGraphicsPipes should not be copied" << endl; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsPipe::operator= -// Access: Public -// Description: assignment operator -//////////////////////////////////////////////////////////////////// -INLINE RIBGraphicsPipe& RIBGraphicsPipe:: -operator=(const RIBGraphicsPipe&) { - cerr << "RIBGraphicsPipes should not be assigned" << endl; - return *this; -} diff --git a/panda/src/ribdisplay/ribGraphicsPipe.cxx b/panda/src/ribdisplay/ribGraphicsPipe.cxx deleted file mode 100644 index 15fb084386..0000000000 --- a/panda/src/ribdisplay/ribGraphicsPipe.cxx +++ /dev/null @@ -1,59 +0,0 @@ -// Filename: ribGraphicsPipe.cxx -// Created by: drose (15Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "ribGraphicsPipe.h" -#include "ribGraphicsWindow.h" -#include "config_ribdisplay.h" - -TypeHandle RIBGraphicsPipe::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsPipe::get_window_type -// Access: Public, Virtual -// Description: Returns the TypeHandle of the kind of window -// preferred by this kind of pipe. -//////////////////////////////////////////////////////////////////// -TypeHandle RIBGraphicsPipe:: -get_window_type() const { - return RIBGraphicsWindow::get_class_type(); -} - - -GraphicsPipe *RIBGraphicsPipe:: -make_RIBGraphicsPipe(const FactoryParams ¶ms) { - GraphicsPipe::PipeSpec *pipe_param; - if (!get_param_into(pipe_param, params)) { - return new RIBGraphicsPipe(PipeSpecifier()); - } else { - return new RIBGraphicsPipe(pipe_param->get_specifier()); - } -} - -TypeHandle RIBGraphicsPipe::get_class_type(void) { - return _type_handle; -} - -void RIBGraphicsPipe::init_type(void) { - NoninteractiveGraphicsPipe::init_type(); - register_type(_type_handle, "RIBGraphicsPipe", - NoninteractiveGraphicsPipe::get_class_type()); -} - -TypeHandle RIBGraphicsPipe::get_type(void) const { - return get_class_type(); -} diff --git a/panda/src/ribdisplay/ribGraphicsPipe.h b/panda/src/ribdisplay/ribGraphicsPipe.h deleted file mode 100644 index 113e6dd0a0..0000000000 --- a/panda/src/ribdisplay/ribGraphicsPipe.h +++ /dev/null @@ -1,73 +0,0 @@ -// Filename: ribGraphicsPipe.h -// Created by: drose (15Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef RIBGRAPHICSPIPE_H -#define RIBGRAPHICSPIPE_H - -#include "pandabase.h" - -#include -#include "noninteractiveGraphicsPipe.h" - - -//////////////////////////////////////////////////////////////////// -// Class : RIBGraphicsPipe -// Description : A place to grab RIBGraphicsWindows from. Not -// terribly exciting in itself. The name of the pipe is -// used as the default RIB output filename for each -// window, but the window may change this. -//////////////////////////////////////////////////////////////////// -class RIBGraphicsPipe : public NoninteractiveGraphicsPipe { -public: - - INLINE RIBGraphicsPipe(const PipeSpecifier&); - - virtual TypeHandle get_window_type() const; - -public: - - static GraphicsPipe *make_RIBGraphicsPipe(const FactoryParams ¶ms); - - static TypeHandle get_class_type(void); - static void init_type(void); - virtual TypeHandle get_type(void) const; - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -public: - - INLINE std::string get_file_name(void) const; - -protected: - - std::string _filename; - -private: - - static TypeHandle _type_handle; - -protected: - - INLINE RIBGraphicsPipe(void); - INLINE RIBGraphicsPipe(const RIBGraphicsPipe&); - INLINE RIBGraphicsPipe& operator=(const RIBGraphicsPipe&); -}; - -#include "ribGraphicsPipe.I" - -#endif - diff --git a/panda/src/ribdisplay/ribGraphicsWindow.I b/panda/src/ribdisplay/ribGraphicsWindow.I deleted file mode 100644 index b56b463ade..0000000000 --- a/panda/src/ribdisplay/ribGraphicsWindow.I +++ /dev/null @@ -1,177 +0,0 @@ -// Filename: ribGraphicsWindow.I -// Created by: drose (17Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "ribGraphicsStateGuardian.h" - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::set_rib_filename_template -// Access: Public -// Description: Specifies the string that defines the filename that -// will be generated for each RIB file output by the -// GraphicsWindow. The template may contain any of the -// % format characters described in ribGraphicsWindow.h. -// In particular, if it contains %f (or some variant), -// there will be a separate RIB file generated for each -// frame; otherwise, all the frames will be written to -// the same RIB file. -//////////////////////////////////////////////////////////////////// -INLINE void RIBGraphicsWindow:: -set_rib_filename_template(const string &str) { - _rib_filename_template = str; - _rib_per_frame = check_per_frame(str); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::get_rib_filename_template -// Access: Public -// Description: Returns the string that defines the RIB filename. -// See set_rib_filename_template(). -//////////////////////////////////////////////////////////////////// -INLINE string RIBGraphicsWindow:: -get_rib_filename_template() const { - return _rib_filename_template; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::get_rib_filename -// Access: Public -// Description: Returns the name of the RIB file that will be created -// at the next (or possibly only the first) call to -// begin_frame(). -//////////////////////////////////////////////////////////////////// -INLINE string RIBGraphicsWindow:: -get_rib_filename() const { - return format_name(_rib_filename_template); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::rib_per_frame -// Access: Public -// Description: Returns true if the RIB filename template contains -// the format specification %f, which means there will -// be a separate RIB file generated for each frame. -//////////////////////////////////////////////////////////////////// -INLINE bool RIBGraphicsWindow:: -rib_per_frame() const { - return _rib_per_frame; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::set_image_filename_template -// Access: Public -// Description: Specifies the string that defines the filename that -// will be written to the RIB file as an output filename -// request. The template may contain any of the -// % format characters descimageed in RIBGraphicsWindow.h. -// In particular, if it contains %f (or some variant), -// there will be a separate image file generated for each -// frame; otherwise, all the frames will be written to -// the same image file, whatever that might mean. -// -// This string may also be empty. If it is, no -// "Display" command will be written to the RIB file, -// and the renderer will choose whatever output filename -// is appropriate. -//////////////////////////////////////////////////////////////////// -INLINE void RIBGraphicsWindow:: -set_image_filename_template(const string &str) { - _image_filename_template = str; - _image_per_frame = check_per_frame(str); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::get_image_filename_template -// Access: Public -// Description: Returns the string that defines the image filename. -// See set_image_filename_template(). -//////////////////////////////////////////////////////////////////// -INLINE string RIBGraphicsWindow:: -get_image_filename_template() const { - return _image_filename_template; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::get_image_filename -// Access: Public -// Description: Returns the name of the image file that will be -// created at the next call to begin_frame(). -//////////////////////////////////////////////////////////////////// -INLINE string RIBGraphicsWindow:: -get_image_filename() const { - return format_name(_image_filename_template); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::image_per_frame -// Access: Public -// Description: Returns true if the image filename template contains -// the format specification %f, which means there will -// be a separate image file generated for each frame. -//////////////////////////////////////////////////////////////////// -INLINE bool RIBGraphicsWindow:: -image_per_frame() const { - return _image_per_frame; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateWindow::set_texture_directory -// Access: Public -// Description: Sets the name of the directory into which texture -// maps are copied to be available to the RIB file. -//////////////////////////////////////////////////////////////////// -INLINE void RIBGraphicsWindow:: -set_texture_directory(const string &directory) { - DCAST(RIBGraphicsStateGuardian, _gsg)->set_texture_directory(directory); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::get_texture_directory -// Access: Public -// Description: Returns the name of the directory into which texture -// maps are copied to be available to the RIB file. -//////////////////////////////////////////////////////////////////// -INLINE string RIBGraphicsWindow:: -get_texture_directory() const { - return DCAST(RIBGraphicsStateGuardian, _gsg)->get_texture_directory(); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::set_texture_extension -// Access: Public -// Description: Specifies the filename extension that texture map -// files are given when they are copied into the -// directory for RIB files. This might also imply an -// image type. The default is "tiff", which implies -// TIFF files. -//////////////////////////////////////////////////////////////////// -INLINE void RIBGraphicsWindow:: -set_texture_extension(const string &extension) { - DCAST(RIBGraphicsStateGuardian, _gsg)->set_texture_extension(extension); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::get_texture_extension -// Access: Public -// Description: Returns the filename extension that texture map -// files are given when they are copied into the -// directory for RIB files. -//////////////////////////////////////////////////////////////////// -INLINE string RIBGraphicsWindow:: -get_texture_extension() const { - return DCAST(RIBGraphicsStateGuardian, _gsg)->get_texture_extension(); -} diff --git a/panda/src/ribdisplay/ribGraphicsWindow.cxx b/panda/src/ribdisplay/ribGraphicsWindow.cxx deleted file mode 100644 index e8b6aeed35..0000000000 --- a/panda/src/ribdisplay/ribGraphicsWindow.cxx +++ /dev/null @@ -1,411 +0,0 @@ -// Filename: ribGraphicsWindow.cxx -// Created by: drose (15Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "ribGraphicsWindow.h" -#include "ribGraphicsPipe.h" -#include "config_ribdisplay.h" - -#include "ribGraphicsStateGuardian.h" -#include - -TypeHandle RIBGraphicsWindow::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -RIBGraphicsWindow:: -RIBGraphicsWindow(GraphicsPipe *pipe) : GraphicsWindow(pipe) { - setup_window(pipe); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -RIBGraphicsWindow:: -RIBGraphicsWindow(GraphicsPipe *pipe, - const GraphicsWindow::Properties &props) : - GraphicsWindow(pipe, props) -{ - setup_window(pipe); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::Destructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -RIBGraphicsWindow:: -~RIBGraphicsWindow(void) { - flush_file(); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::flush_file -// Access: Public -// Description: Finishes the RIB file currently being output and -// closes it. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsWindow:: -flush_file() { - if (_file_begun) { - end_file(); - } -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::begin_frame -// Access: Public, Virtual -// Description: Prepares to write a new frame to the RIB file. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsWindow:: -begin_frame() { - if (!_file_begun) { - // Open a new RIB file if we need to. - begin_file(); - } - - _file << "FrameBegin " << _frame_number << "\n"; - - if (image_per_frame()) { - // If we're writing out an image file for each frame, specify it - // here, inside the Frame control group. - _file << " Display \"" << get_image_filename() - << "\" \"file\" \"rgba\"\n"; - } -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::end_frame -// Access: Public, Virtual -// Description: Finalizes a frame. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsWindow:: -end_frame() { - _file << "FrameEnd\n"; - - if (rib_per_frame()) { - // If we're outputting a RIB file for each frame, close the file now. - end_file(); - } - - GraphicsWindow::end_frame(); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::setup_window -// Access: Protected -// Description: Called by the constructor to initialize whatever -// internal structures are necessary, given the -// indicated pipe and requested properties. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsWindow:: -setup_window(GraphicsPipe *pipe) { - RIBGraphicsPipe *rp = DCAST(RIBGraphicsPipe, pipe); - - _file_begun = false; - - set_rib_filename_template(rp->get_file_name()); - set_image_filename_template(""); - - make_gsg(); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::begin_file -// Access: Protected -// Description: Called internally when a new RIB file needs to be -// created and its suitable headers written. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsWindow:: -begin_file() { - assert(!_file_begun); - RIBGraphicsStateGuardian *rgsg = DCAST(RIBGraphicsStateGuardian, _gsg); - - _file_begun = true; - _current_rib_filename = Filename::text_filename(get_rib_filename()); - assert(!_current_rib_filename.empty()); - - _current_rib_filename.open_write(_file); - rgsg->reset_file(_file); - - if (!_file) { - cerr << "Unable to write to " << _current_rib_filename << "\n"; - return; - } - - _file << - "#\n" - "# RIB file " << _current_rib_filename << "\n" - "#\n"; - - // World set-up - _file << - // "TextureCoordinates 0 1 1 1 0 0 1 0\n" - "Option \"searchpath\" \"shader\" \"shaders:@\"\n"; - - // A default ambient light for when lighting is off - _file << - "LightSource \"ambientlight\" 0 \"intensity\" 1 \"lightcolor\" [ 1 1 1 ]\n" - "Illuminate 0 1\n"; - - - if (!get_image_filename_template().empty() && - !image_per_frame()) { - // If we have an image filename, and it's the same file for all - // frames, specify it outside the Frame control group. Maybe the - // renderer will be able to generate a multi-frame output file - // somehow. - _file << "Display \"" << get_image_filename() - << "\" \"file\" \"rgb\"\n"; - } - -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::end_file -// Access: Protected -// Description: Called internally to wrap up the current RIB file and -// close it. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsWindow:: -end_file() { - assert(_file_begun); - RIBGraphicsStateGuardian *rgsg = DCAST(RIBGraphicsStateGuardian, _gsg); - rgsg->reset(); - - _file_begun = false; - _file.close(); - - cerr << "Wrote " << _current_rib_filename << "\n"; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::format_name -// Access: Protected -// Description: Given a filename template which contains symbols like -// %f etc., replaces the symbols with the appropriate -// values to generate an actual filename. -//////////////////////////////////////////////////////////////////// -string RIBGraphicsWindow:: -format_name(const string &name_template) const { - string name; - - string::const_iterator ci; - ci = name_template.begin(); - while (ci != name_template.end()) { - if (*ci == '%') { - ++ci; - string::const_iterator pi = ci; - while (ci != name_template.end() && isdigit(*ci)) { - ++ci; - } - string format_spec(pi, ci); - - if (ci != name_template.end()) { - switch (*ci) { - case 'f': - // %f : insert frame number - name += format_integer(format_spec, _frame_number); - break; - - case 't': - // %t : insert window title - name += format_string(format_spec, _props._title); - break; - - case '%': - // %% : insert percent sign - name += '%'; - break; - - default: - cerr << "Invalid filename template specification: %" - << format_spec << *ci << "\n"; - } - ++ci; - } else { - cerr << "Incomplete filename template specification: %" - << format_spec << "\n"; - } - } else { - name += *ci; - ++ci; - } - } - - return name; -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::format_integer -// Access: Protected, Static -// Description: Formats an integer according to a %d-like format -// specification found in a filename template. -// format_spec is the string between the percent sign -// and the command letter (which might be empty, or -// might contain a field width), and number is the value -// to format. -//////////////////////////////////////////////////////////////////// -string RIBGraphicsWindow:: -format_integer(const string &format_spec, int number) { - // Get the field width requirement. We don't care if it begins with - // a leading zero or not, since we always pad with zeroes. - int width = atoi(format_spec.c_str()); - - string result; - string sign; - - // Is the number negative? - if (number < 0) { - sign = '-'; - number = -number; - } - - // Now build the number from the least-significant digit up. We - // keep going until the width runs out or the number does, whichever - // lasts longer. - do { - int digit = number % 10; - number /= 10; - - result = (char)(digit + '0') + result; - width--; - } while (width > 0 || number != 0); - - return sign + result; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::format_string -// Access: Protected, Static -// Description: Formats a string according to a %s-like format -// specification found in a filename template. -// format_spec is the string between the percent sign -// and the command letter (which might be empty, or -// might contain a field width), and str is the value -// to format. -//////////////////////////////////////////////////////////////////// -string RIBGraphicsWindow:: -format_string(const string &format_spec, const string &str) { - int width = atoi(format_spec.c_str()); - if (width <= str.length()) { - return str; - } - - // Now we have to pad the string out. - string pad; - - for (int extra = width; extra < str.length(); extra++) { - pad += '-'; - } - return pad + str; -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::format_string -// Access: Protected, Static -// Description: Scans a name template for the appearance of %f (or -// some variant), and returns true if it appears, false -// otherwise. -//////////////////////////////////////////////////////////////////// -bool RIBGraphicsWindow:: -check_per_frame(const string &name_template) { - string::const_iterator ci; - ci = name_template.begin(); - while (ci != name_template.end()) { - if (*ci == '%') { - ++ci; - string::const_iterator pi = ci; - while (ci != name_template.end() && isdigit(*ci)) { - ++ci; - } - - if (ci != name_template.end()) { - if ((*ci) == 'f') { - return true; - } - ++ci; - } - } else { - ++ci; - } - } - - return false; -} - -void RIBGraphicsWindow::make_current(void) { -} - -void RIBGraphicsWindow::unmake_current(void) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsWindow::get_gsg_type -// Access: Public, Virtual -// Description: Returns the TypeHandle of the kind of GSG preferred -// by this kind of window. -//////////////////////////////////////////////////////////////////// -TypeHandle RIBGraphicsWindow:: -get_gsg_type() const { - return RIBGraphicsStateGuardian::get_class_type(); -} - -GraphicsWindow* -RIBGraphicsWindow::make_RibGraphicsWindow(const FactoryParams ¶ms) { - GraphicsWindow::WindowPipe *pipe_param; - if (!get_param_into(pipe_param, params)) { - ribdisplay_cat.error() - << "No pipe specified for window creation!" << endl; - return NULL; - } - - GraphicsPipe *pipe = pipe_param->get_pipe(); - - GraphicsWindow::WindowProps *props_param; - if (!get_param_into(props_param, params)) { - return new RIBGraphicsWindow(pipe); - } else { - return new RIBGraphicsWindow(pipe, props_param->get_properties()); - } -} - -TypeHandle RIBGraphicsWindow::get_class_type(void) { - return _type_handle; -} - -void RIBGraphicsWindow::init_type(void) { - GraphicsWindow::init_type(); - register_type(_type_handle, "RIBGraphicsWindow", - GraphicsWindow::get_class_type()); -} - -TypeHandle RIBGraphicsWindow::get_type(void) const { - return get_class_type(); -} diff --git a/panda/src/ribdisplay/ribGraphicsWindow.h b/panda/src/ribdisplay/ribGraphicsWindow.h deleted file mode 100644 index 69f5732cc4..0000000000 --- a/panda/src/ribdisplay/ribGraphicsWindow.h +++ /dev/null @@ -1,147 +0,0 @@ -// Filename: ribGraphicsWindow.h -// Created by: drose (15Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef RIBGRAPHICSWINDOW_H -#define RIBGRAPHICSWINDOW_H - -//////////////////////////////////////////////////////////////////// -// -// A RIBGraphicsWindow, instead of actually being a window on some -// raster display device, instead represents a file (or sequence of -// files) on disk that will be filled with a RIB scene description -// when the scene is "rendered" to the window. This RIB may -// subsequently be used as input to a standalone renderer such as -// prman or BMRT to generate one or more images. -// -// The output RIB filename as specified to the window is actually a -// filename template, and may contain any of the following: -// -// %f This stands for the current frame number. The frame number -// starts counting at zero when the window is created and -// increments by one each time a frame is rendered. An optional -// field width may appear after the %, printf-style. -// -// %t This stands for the window title. -// -// %% This stands for a single percent sign. -// -// If the RIB filename contains %f, a separate RIB file is generated -// for each frame rendered; otherwise, all frames are written into a -// single multi-frame RIB file. -// -// -// The image filename may also be specified. If specified, a -// "Display" command is written to the RIB file to output the image to -// the indicated filename. If unspecified or empty, the "Display" -// command is not written, and the renderer chooses the output -// filename. The image filename may also contain any of the % -// sequences described above. -// -//////////////////////////////////////////////////////////////////// - - -#include "pandabase.h" - -#include "graphicsWindow.h" -#include "filename.h" - -class RIBGraphicsPipe; - - -//////////////////////////////////////////////////////////////////// -// Class : RIBGraphicsWindow -// Description : Represents a specific RIB file (or sequence of files) -// that can be "rendered" to. Rendering to a RIB file -// means writing out a scene description to the file. -// -// The filename of the RIB file is initially taken from -// the name of the RIBGraphicsPipe used to create the -// window, but it may subsequently be changed via -// set_rib_filename_template(). The filename may -// contain any of the % sequences described above. -//////////////////////////////////////////////////////////////////// -class RIBGraphicsWindow : public GraphicsWindow { - public: - - RIBGraphicsWindow(GraphicsPipe *pipe); - RIBGraphicsWindow(GraphicsPipe *pipe, - const GraphicsWindow::Properties &props); - virtual ~RIBGraphicsWindow(void); - - INLINE void set_rib_filename_template(const string &str); - INLINE string get_rib_filename_template() const; - INLINE string get_rib_filename() const; - INLINE bool rib_per_frame() const; - - INLINE void set_image_filename_template(const string &str); - INLINE string get_image_filename_template() const; - INLINE string get_image_filename() const; - INLINE bool image_per_frame() const; - - INLINE void set_texture_directory(const string &directory); - INLINE string get_texture_directory() const; - INLINE void set_texture_extension(const string &extension); - INLINE string get_texture_extension() const; - - void flush_file(); - - virtual void begin_frame(); - virtual void end_frame(); - - virtual void make_current(void); - virtual void unmake_current(void); - - virtual TypeHandle get_gsg_type() const; - static GraphicsWindow* make_RibGraphicsWindow(const FactoryParams ¶ms); - -protected: - void setup_window(GraphicsPipe *pipe); - - void begin_file(); - void end_file(); - - string format_name(const string &name_template) const; - static string format_integer(const string &format_spec, int number); - static string format_string(const string &format_spec, const string &str); - - static bool check_per_frame(const string &name_template); - - string _rib_filename_template; - string _image_filename_template; - bool _rib_per_frame; - bool _image_per_frame; - - bool _file_begun; - Filename _current_rib_filename; - ofstream _file; - -public: - - static TypeHandle get_class_type(void); - static void init_type(void); - virtual TypeHandle get_type(void) const; - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -private: - - static TypeHandle _type_handle; -}; - -#include "ribGraphicsWindow.I" - -#endif diff --git a/panda/src/ribgsg/Sources.pp b/panda/src/ribgsg/Sources.pp deleted file mode 100644 index 6f66246edf..0000000000 --- a/panda/src/ribgsg/Sources.pp +++ /dev/null @@ -1,20 +0,0 @@ -#define BUILD_DIRECTORY $[HAVE_RIB] - -#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \ - dtoolutil:c dtoolbase:c dtool:m - -#begin lib_target - #define TARGET ribgsg - #define LOCAL_LIBS \ - pgraph gsgmisc display gobj - - #define SOURCES \ - config_ribgsg.cxx config_ribgsg.h ribGraphicsStateGuardian.I \ - ribGraphicsStateGuardian.cxx ribGraphicsStateGuardian.h \ - ribStuffTraverser.cxx ribStuffTraverser.h - - #define INSTALL_HEADERS \ - ribGraphicsStateGuardian.h - -#end lib_target - diff --git a/panda/src/ribgsg/config_ribgsg.cxx b/panda/src/ribgsg/config_ribgsg.cxx deleted file mode 100644 index 94789de1a4..0000000000 --- a/panda/src/ribgsg/config_ribgsg.cxx +++ /dev/null @@ -1,32 +0,0 @@ -// Filename: config_ribgsg.cxx -// Created by: cary (08Oct99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "config_ribgsg.h" -#include "ribGraphicsStateGuardian.h" - -#include "dconfig.h" - -Configure(config_ribgsg); -NotifyCategoryDef(ribgsg, ":display:gsg"); - -ConfigureFn(config_ribgsg) { - RIBGraphicsStateGuardian::init_type(); - GraphicsStateGuardian::get_factory(). - register_factory(RIBGraphicsStateGuardian::get_class_type(), - RIBGraphicsStateGuardian::make_RIBGraphicsStateGuardian); -} diff --git a/panda/src/ribgsg/config_ribgsg.h b/panda/src/ribgsg/config_ribgsg.h deleted file mode 100644 index e6343d23cd..0000000000 --- a/panda/src/ribgsg/config_ribgsg.h +++ /dev/null @@ -1,27 +0,0 @@ -// Filename: config_ribgsg.h -// Created by: cary (08Oct99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef CONFIG_RIBGSG_H -#define CONFIG_RIBGSG_H - -#include "pandabase.h" -#include "notifyCategoryProxy.h" - -NotifyCategoryDecl(ribgsg, EXPCL_PANDARIB, EXPTP_PANDARIB); - -#endif diff --git a/panda/src/ribgsg/ribGraphicsStateGuardian.I b/panda/src/ribgsg/ribGraphicsStateGuardian.I deleted file mode 100644 index 13a1c7bd4d..0000000000 --- a/panda/src/ribgsg/ribGraphicsStateGuardian.I +++ /dev/null @@ -1,17 +0,0 @@ -// Filename: ribGraphicsStateGuardian.I -// Created by: drose (15Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// diff --git a/panda/src/ribgsg/ribGraphicsStateGuardian.cxx b/panda/src/ribgsg/ribGraphicsStateGuardian.cxx deleted file mode 100644 index 4dc828d448..0000000000 --- a/panda/src/ribgsg/ribGraphicsStateGuardian.cxx +++ /dev/null @@ -1,1242 +0,0 @@ -// Filename: ribGraphicsStateGuardian.cxx -// Created by: drose (15Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "ribGraphicsStateGuardian.h" -#include "ribStuffTraverser.h" -#include "config_ribgsg.h" - -#include "directRenderTraverser.h" -#include "displayRegion.h" -#include "projectionNode.h" -#include "projection.h" -#include "camera.h" -#include "renderBuffer.h" -#include "transformTransition.h" -#include "colorTransition.h" -#include "textureTransition.h" -#include "lightTransition.h" -#include "geom.h" -#include "geomprimitives.h" -#include "geomIssuer.h" -#include "graphicsWindow.h" -#include "graphicsChannel.h" -#include "indent.h" -#include "dftraverser.h" -#include "node.h" -#include "projectionNode.h" -#include "texture.h" -#include "textureContext.h" -#include "light.h" -#include "get_rel_pos.h" -#include "projection.h" -#include "perspectiveProjection.h" -#include "frustum.h" -#include "ambientLight.h" -#include "directionalLight.h" -#include "pointLight.h" -#include "spotlight.h" -#include "pandabase.h" - -#include - -TypeHandle RIBGraphicsStateGuardian::_type_handle; - -// Here are some global arrays we use in the various draw() routines -// to hold temporary coordinate values for each Geom for formatting. - -static pvector rib_vertices; -static pvector rib_normals; -static pvector rib_texcoords; -static pvector rib_colors; - -static void -issue_vertex_rib(const Geom *geom, Geom::VertexIterator &vi) { - rib_vertices.push_back(geom->get_next_vertex(vi)); -} - -static void -issue_normal_rib(const Geom *geom, Geom::NormalIterator &ni) { - rib_normals.push_back(geom->get_next_normal(ni)); -} - -static void -issue_texcoord_rib(const Geom *geom, Geom::TexCoordIterator &ti) { - // We need to reverse the V coordinate for RIB. - static LMatrix3f - texmat(1.0, 0.0, 0.0, - 0.0, -1.0, 0.0, - 0.0, 1.0, 1.0); - rib_texcoords.push_back(geom->get_next_texcoord(ti) * texmat); -} - -static void -issue_color_rib(const Geom *geom, Geom::ColorIterator &ci, - const GraphicsStateGuardianBase *) { - // RIB only cares about three-component color, so we have to convert - // the four-component color transition to three-component color here. - rib_colors.push_back((const RGBColorf &)geom->get_next_color(ci)); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -RIBGraphicsStateGuardian:: -RIBGraphicsStateGuardian(GraphicsWindow *win) : GraphicsStateGuardian(win) { - reset(); - - // Create a default RenderTraverser. - _render_traverser = - new DirectRenderTraverser(this, RenderRelation::get_class_type()); - - _texture_directory = "maps"; - _texture_extension = "tiff"; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::reset -// Access: Public, Virtual -// Description: Resets all internal state and prepares a new RIB -// file. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -reset() { - GraphicsStateGuardian::reset(); - - // We only have a color buffer in RenderMan. - _buffer_mask = RenderBuffer::T_color; - - _output = NULL; - _indent_level = 0; - - // We clear the texture names only for each file, not for each - // frame, because texture definitions remain across frames. - _texture_names.clear(); - - reset_frame(); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::reset_file -// Access: Public -// Description: Resets all internal state and prepares a new RIB -// file to the indicated output stream. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -reset_file(ostream &out) { - reset(); - _output = &out; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::reset_frame -// Access: Public -// Description: Resets whatever state is appropriate at the end of a -// frame. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -reset_frame() { - // We must clear the light definitions for each frame. - _light_ids.clear(); - _enabled_lights.clear(); - _enabled_lights.push_back(true); - - _current_color.set(1.0, 1.0, 1.0); - _state.clear(); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::clear -// Access: Public, Virtual -// Description: Clears all of the indicated buffers to their assigned -// colors. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -clear(const RenderBuffer &) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::clear -// Access: Public, Virtual -// Description: Clears all of the indicated buffers to their assigned -// colors. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -clear(const RenderBuffer &, const DisplayRegion* ) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::prepare_display_region -// Access: Public -// Description: Prepare a display region for rendering (set up -// scissor region and viewport) -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -prepare_display_region() { -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::render_frame -// Access: Public, Virtual -// Description: Renders an entire frame, including all display -// regions within the frame, and includes any necessary -// pre- and post-processing. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -render_frame(const AllTransitionsWrapper &initial_state) { - _win->begin_frame(); - assert(_output != NULL); - _indent_level += 2; - - int max_channel_index = _win->get_max_channel_index(); - for (int c = 0; c < max_channel_index; c++) { - if (_win->is_channel_defined(c)) { - GraphicsChannel *chan = _win->get_channel(c); - if (chan->is_active()) { - int num_layers = chan->get_num_layers(); - for (int l = 0; l < num_layers; l++) { - GraphicsLayer *layer = chan->get_layer(l); - if (layer->is_active()) { - int num_drs = layer->get_num_drs(); - for (int d = 0; d < num_drs; d++) { - DisplayRegion *dr = layer->get_dr(d); - Camera *cam = dr->get_camera(); - - // For each display region, render from the camera's view. - if (dr->is_active() && cam != (Camera *)NULL && - cam->is_active() && cam->get_scene() != (Node *)NULL) { - DisplayRegionStack old_dr = push_display_region(dr); - prepare_display_region(); - render_scene(cam->get_scene(), cam, initial_state); - pop_display_region(old_dr); - } - } - } - } - } - } - } - - _indent_level -= 2; - _win->end_frame(); - - reset_frame(); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::render_scene -// Access: Public, Virtual -// Description: Renders an entire scene, from the root node of the -// scene graph, as seen from a particular ProjectionNode -// and with a given initial state. This initial state -// may be modified during rendering. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -render_scene(Node *root, ProjectionNode *projnode, - const AllTransitionsWrapper &initial_state) { - _current_root_node = root; - - render_subgraph(_render_traverser, root, projnode, - initial_state, AllTransitionsWrapper()); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::render_subgraph -// Access: Public, Virtual -// Description: Renders a subgraph of the scene graph as seen from a -// given projection node, and with a particular initial -// state. This state may be modified by the render -// process. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -render_subgraph(RenderTraverser *traverser, - Node *subgraph, ProjectionNode *projnode, - const AllTransitionsWrapper &initial_state, - const AllTransitionsWrapper &net_trans) { - ProjectionNode *old_projection_node = _current_projection_node; - _current_projection_node = projnode; - - (*_output) << "\n"; - - int width = _win->get_width(); - int height = _win->get_height(); - float frame_aspect = (float)width / (float)height; - - // BMRT, for one, doesn't seem like general matrices for the - // projection matrix. Therefore, we'll examine the projection type - // and write out the high-level description of the projection if we - // can, instead of just dumping a matrix. - - const Projection *projection = projnode->get_projection(); - if (projection->is_of_type(PerspectiveProjection::get_class_type())) { - const PerspectiveProjection &pp = - *DCAST(PerspectiveProjection, projection); - const Frustumf &frustum = pp.get_frustum(); - - float yfov, fnear, ffar; - frustum.get_perspective_params(yfov, frame_aspect, fnear, ffar); - - switch (_coordinate_system) { - case CS_zup_right: - new_line() << "Scale [ 1 1 -1 ]\n"; // left-handed to right-handed - new_line() << "Rotate [ -90 1 0 0 ]\n"; // y-up to z-up - break; - - case CS_zup_left: - new_line() << "Rotate [ -90 1 0 0 ]\n"; // y-up to z-up - break; - - case CS_yup_right: - new_line() << "Scale [ 1 1 -1 ]\n"; // left-handed to right-handed - break; - - case CS_yup_left: - break; - }; - - new_line() << "Orientation \"lh\"\n"; - new_line() << "Clipping " << fnear << " " << ffar << "\n"; - new_line() << "Projection \"perspective\" \"fov\" " << yfov << "\n"; - - } else { - // Hmm, some unknown projection type. We'll have to just write - // out the projection matrix and hope for the best. - LMatrix4f proj_mat = projection->get_projection_mat(_coordinate_system); - concat_transform(proj_mat); - - new_line() << "Orientation \"lh\"\n"; - new_line() << "Projection \"null\"\n"; - } - - new_line() << "Format " << width << " " << height << " " - << (float)height * frame_aspect / (float)width << "\n"; - new_line() << "FrameAspectRatio " << frame_aspect << "\n"; - - new_line() << "Sides 1\n"; - new_line() << "Color [ 1 1 1 ]\n"; - - // Get the lights and stuff, while we're here in camera space. - get_rib_stuff(_current_root_node, initial_state); - - // We infer the modelview matrix by doing a wrt on the projection - // node. - LMatrix4f modelview_mat; - get_rel_mat(subgraph, _current_projection_node, modelview_mat); - concat_transform(modelview_mat); - - /* - // And then we must make sure the matrix transform is cleared from - // the initial state. - initial_state.clear_attribute(TransformTransition::get_class_type()); - */ - - new_line() << "WorldBegin\n"; - _indent_level += 2; - - render_subgraph(traverser, subgraph, initial_state, net_trans); - - _indent_level -= 2; - new_line() << "WorldEnd\n"; -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::render_subgraph -// Access: Public, Virtual -// Description: Renders a subgraph of the scene graph as seen from the -// current projection node, and with a particular -// initial state. This state may be modified during the -// render process. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -render_subgraph(RenderTraverser *traverser, - Node *subgraph, - const AllTransitionsWrapper &initial_state, - const AllTransitionsWrapper &net_trans) { - nassertv(traverser != (RenderTraverser *)NULL); - traverser->traverse(subgraph, initial_state, net_trans); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::wants_normals -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -bool RIBGraphicsStateGuardian:: -wants_normals() const { - return true; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::wants_texcoords -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -bool RIBGraphicsStateGuardian:: -wants_texcoords() const { - return true; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::wants_colors -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -bool RIBGraphicsStateGuardian:: -wants_colors() const { - // If we have scene graph color enabled, return false to indicate we - // shouldn't bother issuing geometry color commands. - - const ColorTransition *catt; - if (!get_transition_into(catt, _state, ColorTransition::get_class_type())) { - // No scene graph color at all. - return true; - } - - // We should issue geometry colors only if the scene graph color is - // off. - return catt->is_off(); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::compute_distance_to -// Access: Public, Virtual -// Description: This function may only be called during a render -// traversal; it will compute the distance to the -// indicated point, assumed to be in modelview -// coordinates, from the camera plane. -//////////////////////////////////////////////////////////////////// -float RIBGraphicsStateGuardian:: -compute_distance_to(const LPoint3f &point) const { - // In the case of a RIBGraphicsStateGuardian, we know the modelview - // matrix does not include the camera transform, so we should apply - // that now. But for now we'll punt, since no one cares anyway. - - return point[1]; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_point -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_point(const GeomPoint *) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_line -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_line(const GeomLine *) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_sprite -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_sprite(const GeomSprite *) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_polygon -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_polygon(const GeomPolygon *geom) { - draw_simple_poly(geom); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_tri -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_tri(const GeomTri *geom) { - draw_simple_poly(geom); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_quad -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_quad(const GeomQuad *geom) { - draw_simple_poly(geom); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_tristrip -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_tristrip(const GeomTristrip *geom) { - Geom *temp = geom->explode(); - draw_simple_poly(temp); - delete temp; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_trifan -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_trifan(const GeomTrifan *geom) { - Geom *temp = geom->explode(); - draw_simple_poly(temp); - delete temp; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_sphere -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_sphere(const GeomSphere *) { -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::prepare_texture -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -TextureContext *RIBGraphicsStateGuardian:: -prepare_texture(Texture *tex) { - TextureContext *tc = new TextureContext(tex); - - bool inserted = mark_prepared_texture(tc); - - // If this assertion fails, the same texture was prepared twice, - // which shouldn't be possible, since the texture itself should - // detect this. - assert(inserted); - - return tc; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::apply_texture -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -apply_texture(TextureContext *) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::release_texture -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -release_texture(TextureContext *tc) { - Texture *tex = tc->_texture; - - bool erased = unmark_prepared_texture(tc); - - // If this assertion fails, a texture was released that hadn't been - // prepared (or a texture was released twice). - assert(erased); - - tex->clear_gsg(this); - - delete tc; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::copy_texture -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -copy_texture(TextureContext *, const DisplayRegion *) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::copy_texture -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -copy_texture(TextureContext *, const DisplayRegion *, const RenderBuffer &) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_texture -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_texture(TextureContext *, const DisplayRegion *) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_texture -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_texture(TextureContext *, const DisplayRegion *, const RenderBuffer &) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::copy_pixel_buffer -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -copy_pixel_buffer(PixelBuffer *, const DisplayRegion *) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::copy_pixel_buffer -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -copy_pixel_buffer(PixelBuffer *, const DisplayRegion *, const RenderBuffer &) { -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_pixel_buffer -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_pixel_buffer(PixelBuffer *, const DisplayRegion *, - const NodeTransitions &) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_pixel_buffer -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_pixel_buffer(PixelBuffer *, const DisplayRegion *, const RenderBuffer &, - const NodeTransitions &) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::issue_transform -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -issue_transform(const TransformTransition *attrib) { - reset_transform(attrib->get_matrix()); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::issue_color -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -issue_color(const ColorTransition *attrib) { - if (attrib->is_on() && attrib->is_real()) { - const Colorf c = attrib->get_color(); - set_color(RGBColorf(c[0], c[1], c[2])); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::issue_texture -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -issue_texture(const TextureTransition *attrib) { - if (attrib->is_off()) { - // If no textures are enabled, we can use the nontextured shader. - new_line() - << "Surface \"plastic\"\n"; - - } else { - // If we have a texture enabled, just use the normal - // paintedplastic shader. - - Texture *tex = attrib->get_texture(); - nassertv(tex != (Texture *)NULL); - const Filename &rib_name = _texture_names[tex]; - - // We should have gotten all the texture names already in the - // get_rib_stuff() call. If this name is empty, we somehow - // missed it! - nassertv(!rib_name.empty()); - - new_line() - << "Surface \"paintedplastic\" \"texturename\" \"" - << rib_name << "\"\n"; - } -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::issue_light -// Access: Public, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -issue_light(const LightTransition *attrib) { - nassertv(attrib->get_properties_is_on()); - int num_enabled = attrib->size(); - if (num_enabled == 0) { - // If no lights are enabled, lighting is off. Turn off all lights - // except the default one. - - // (if the default light is already on, we'll assume everything - // else is already off and won't bother to run the list.) - if (!_enabled_lights[0]) { - for (int i = 1; i < _enabled_lights.size(); i++) { - if (_enabled_lights[i]) { - new_line() << "Illuminate " << i << " 0\n"; - _enabled_lights[i] = false; - } - } - - // And turn on the default light, which illuminates the scene in - // the absence of lighting. - new_line() << "Illuminate 0 1\n"; - _enabled_lights[0] = true; - } - - } else { - // If some lights are enabled, we'll turn off the ones that were - // enabled from before, and turn on the ones we need. - - LightTransition::const_iterator li; - for (li = attrib->begin(); li != attrib->end(); ++li) { - Light *light = (*li); - LightIDs::const_iterator ii = _light_ids.find(light); - assert(ii != _light_ids.end()); - int id = (*ii).second; - - if (!_enabled_lights[id]) { - new_line() << "Illuminate " << id << " 1\n"; - } - - // We'll temporarily set the enabled flag to false, even - // though we've just activated the light. This is so we can - // later identify the lights we need to turn off. - _enabled_lights[id] = false; - } - - // Now turn off all the lights that are still marked "on". - for (int i = 0; i < _enabled_lights.size(); i++) { - if (_enabled_lights[i]) { - new_line() << "Illuminate " << i << " 0\n"; - _enabled_lights[i] = false; - } - } - - // Finally, mark as "on" all the ones that we just enabled. - for (li = attrib->begin(); li != attrib->end(); ++li) { - Light *light = (*li); - int id = _light_ids[light]; - _enabled_lights[id] = true; - } - } -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::set_texture_directory -// Access: Public -// Description: Sets the name of the directory into which texture -// maps are copied to be available to the RIB file. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -set_texture_directory(const string &directory) { - _texture_directory = directory; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::get_texture_directory -// Access: Public -// Description: Returns the name of the directory into which texture -// maps are copied to be available to the RIB file. -//////////////////////////////////////////////////////////////////// -string RIBGraphicsStateGuardian:: -get_texture_directory() const { - return _texture_directory; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::set_texture_extension -// Access: Public -// Description: Specifies the filename extension that texture map -// files are given when they are copied into the -// directory for RIB files. This might also imply an -// image type. The default is "tiff", which implies -// TIFF files. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -set_texture_extension(const string &extension) { - _texture_extension = extension; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::get_texture_extension -// Access: Public -// Description: Returns the filename extension that texture map -// files are given when they are copied into the -// directory for RIB files. -//////////////////////////////////////////////////////////////////// -string RIBGraphicsStateGuardian:: -get_texture_extension() const { - return _texture_extension; -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::save_frame_buffer -// Access: Public -// Description: Saves the indicated planes of the frame buffer -// (within the indicated display region) and returns it -// in some meaningful form that can be restored later -// via restore_frame_buffer(). This is a helper -// function for push_frame_buffer() and -// pop_frame_buffer(). -//////////////////////////////////////////////////////////////////// -PT(SavedFrameBuffer) RIBGraphicsStateGuardian:: -save_frame_buffer(const RenderBuffer &buffer, - CPT(DisplayRegion) dr) { - return new SavedFrameBuffer(buffer, dr); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::restore_frame_buffer -// Access: Public -// Description: Restores the frame buffer that was previously saved. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -restore_frame_buffer(SavedFrameBuffer *) { -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::set_color -// Access: Protected -// Description: Issues the sequence to change the node color to that -// indicated. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -set_color(const RGBColorf &color) { - if (_current_color != color) { - new_line() << "Color [ " << color << " ]\n"; - _current_color = color; - } -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::get_rib_stuff -// Access: Protected -// Description: Traverses the scene graph to identify any textures -// or lights, or anything that we need to define up -// front in RIB. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -get_rib_stuff(Node *root, const AllTransitionsWrapper &initial_state) { - RibStuffTraverser trav(this); - df_traverse(root, trav, initial_state, NullLevelState(), - RenderRelation::get_class_type()); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::define_texture -// Access: Protected -// Description: Called by the RibStuffTraverser (initiated above), -// this defines a single texture object in the RIB file -// if it has not already been defined. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -define_texture(const Texture *tex) { - Filename &rib_name = _texture_names[tex]; - - if (rib_name.empty()) { - Filename image_filename = tex->get_name(); - image_filename.set_dirname(_texture_directory); - image_filename.set_extension(_texture_extension); - tex->write(image_filename); - - rib_name = image_filename; - rib_name.set_extension("tx"); - - new_line() << "MakeTexture \"" << image_filename << "\"\n"; - new_line(12) << "\"" << rib_name << "\""; - - if (tex->get_wrapu() == Texture::WM_clamp) { - (*_output) << " \"clamp\""; - } else { - (*_output) << " \"periodic\""; - } - - if (tex->get_wrapv() == Texture::WM_clamp) { - (*_output) << " \"clamp\""; - } else { - (*_output) << " \"periodic\""; - } - - (*_output) << " \"box\" 1 1\n"; - } -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::define_light -// Access: Protected -// Description: Called by the RibStuffTraverser (initiated above), -// this defines a single light object in the RIB file -// if it has not already been defined. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -define_light(const Light *light) { - LightIDs::const_iterator li = _light_ids.find(light); - if (li == _light_ids.end()) { - // This is the first time this light has been encountered; define - // it. - - // Create a new ID number. - int id = _light_ids.size() + 1; - _light_ids[light] = id; - assert(id == _enabled_lights.size()); - _enabled_lights.push_back(false); - - if (light->get_light_type() == PointLight::get_class_type()) { - const PointLight *plight = (const PointLight *)light; - new_line() << "LightSource \"pointlight\" " << id; - write_light_color(plight->get_color()); - write_light_from(plight); - (*_output) << "\n"; - - } else if (light->get_light_type() == DirectionalLight::get_class_type()) { - const DirectionalLight *dlight = (const DirectionalLight *)light; - new_line() << "LightSource \"distantlight\" " << id; - write_light_color(dlight->get_color()); - write_light_from(dlight); - write_light_to(dlight); - (*_output) << "\n"; - - } else if (light->get_light_type() == Spotlight::get_class_type()) { - const Spotlight *slight = (const Spotlight *)light; - new_line() << "LightSource \"spotlight\" " << id; - write_light_color(slight->get_color()); - write_light_from(slight); - write_light_to(slight); - (*_output) - << " \"coneangle\" " << deg_2_rad(slight->get_cutoff_angle()) - << "\n"; - - } else if (light->get_light_type() == AmbientLight::get_class_type()) { - const AmbientLight *alight = (const AmbientLight *)light; - new_line() << "LightSource \"ambientlight\" " << id; - write_light_color(alight->get_color()); - (*_output) << "\n"; - - } else { - cerr << "Ignoring unknown light type " << light->get_light_type() << "\n"; - } - } -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::write_light_color -// Access: Protected -// Description: Called by define_light() to write out a single -// light's color and intensity values. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -write_light_color(const Colorf &color) const { - RGBColorf output_color; - float intensity; - - get_color_and_intensity((const RGBColorf &)color, output_color, intensity); - (*_output) << " \"lightcolor\" [ " << output_color << " ] \"intensity\" " - << intensity; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::write_light_from -// Access: Protected -// Description: Called by define_light() to write out a single -// light's position. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -write_light_from(const Node *light) const { - LPoint3f pos = get_rel_pos(light, _current_projection_node); - - (*_output) << " \"from\" [ " << pos << " ]"; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::write_light_to -// Access: Protected -// Description: Called by define_light() to write out a single -// light's direction. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -write_light_to(const Node *light) const { - LPoint3f pos = get_rel_pos(light, _current_projection_node); - LVector3f forward = get_rel_forward(light, _current_projection_node); - - (*_output) << " \"to\" [ " << pos + forward << " ]"; -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::new_line -// Access: Protected -// Description: Beins a new line of output at the current indenting -// level. (Does not actually issue the newline -// character, however). -//////////////////////////////////////////////////////////////////// -ostream &RIBGraphicsStateGuardian:: -new_line(int extra_indent) const { - return indent(*_output, _indent_level + extra_indent); -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::reset_transform -// Access: Protected -// Description: Outputs an RiTransform command with the given -// transformation matrix, which resets the current -// transformation to that specified. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -reset_transform(const LMatrix4f &mat) const { - new_line() << "Transform [ " << mat(0,0) << " " << mat(0,1) << " " - << mat(0,2) << " " << mat(0,3) << "\n"; - new_line(12) << mat(1,0) << " " << mat(1,1) << " " - << mat(1,2) << " " << mat(1,3) << "\n"; - new_line(12) << mat(2,0) << " " << mat(2,1) << " " - << mat(2,2) << " " << mat(2,3) << "\n"; - new_line(12) << mat(3,0) << " " << mat(3,1) << " " - << mat(3,2) << " " << mat(3,3) << " ]\n"; -} - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::concat_transform -// Access: Protected -// Description: Outputs an RiTransform command with the given -// transformation matrix, which composes the specified -// matrix with the current transformation. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -concat_transform(const LMatrix4f &mat) const { - new_line() << "ConcatTransform [ " << mat(0,0) << " " << mat(0,1) << " " - << mat(0,2) << " " << mat(0,3) << "\n"; - new_line(18) << mat(1,0) << " " << mat(1,1) << " " - << mat(1,2) << " " << mat(1,3) << "\n"; - new_line(18) << mat(2,0) << " " << mat(2,1) << " " - << mat(2,2) << " " << mat(2,3) << "\n"; - new_line(18) << mat(3,0) << " " << mat(3,1) << " " - << mat(3,2) << " " << mat(3,3) << " ]\n"; -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::draw_simple_poly -// Access: Protected -// Description: Draws a GeomPolygon, GeomTri, or GeomQuad object. -// This consists of one or more unconnected polygons. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -draw_simple_poly(const Geom *geom) { - if (geom == NULL) { - return; - } - - int nprims = geom->get_num_prims(); - Geom::VertexIterator vi = geom->make_vertex_iterator(); - Geom::NormalIterator ni = geom->make_normal_iterator(); - Geom::TexCoordIterator ti = geom->make_texcoord_iterator(); - Geom::ColorIterator ci = geom->make_color_iterator(); - - GeomIssuer issuer(geom, this, - issue_vertex_rib, - issue_normal_rib, - issue_texcoord_rib, - issue_color_rib); - - for (int i = 0; i < nprims; i++) { - // First, for each primitive, we build up the various polygon - // attributes in our global arrays. - - // If the colors or normals have overall binding, we'll need to - // repeat it for each primitive. Thus, we need to reset the - // iterator for each primitive. - if (geom->get_binding(G_COLOR) == G_OVERALL) { - ci = geom->make_color_iterator(); - } - if (geom->get_binding(G_NORMAL) == G_OVERALL) { - ni = geom->make_normal_iterator(); - } - - // Draw overall - issuer.issue_color(G_OVERALL, ci); - issuer.issue_normal(G_OVERALL, ni); - - // Draw per primitive - issuer.issue_color(G_PER_PRIM, ci); - issuer.issue_normal(G_PER_PRIM, ni); - - for (int j = 0; j < geom->get_length(i); j++) { - // Draw per vertex - issuer.issue_color(G_PER_VERTEX, ci); - issuer.issue_normal(G_PER_VERTEX, ni); - issuer.issue_texcoord(G_PER_VERTEX, ti); - issuer.issue_vertex(G_PER_VERTEX, vi); - } - - write_polygon(geom->get_length(i)); - } -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::write_polygon -// Access: Protected -// Description: Writes out the RIB command to draw the polygon -// described by the global rib_* arrays. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -write_polygon(int num_verts) { - if (num_verts < 3) { - return; - } - - assert(rib_vertices.size() == num_verts); - - if (rib_colors.size() == 1) { - // This polygon has a flat color; just issue the color. - set_color(rib_colors[0]); - rib_colors.clear(); - } - - - // We reverse the order of the vertices when we write then out, - // because RIB has a clockwise-ordering convention. - - // Vertices are always per-vertex. - write_long_list(*_output, _indent_level, - rib_vertices.rbegin(), rib_vertices.rend(), - "Polygon \"P\" ", " ", 72); - - if (rib_normals.size() == 1) { - // A single polygon normal. - write_long_list(*_output, _indent_level, - rib_normals.rbegin(), rib_normals.rend(), - " \"Np\" ", " ", 72); - } else if (!rib_normals.empty()) { - // Multiple per-vertex normals. - assert(rib_normals.size() == num_verts); - write_long_list(*_output, _indent_level, - rib_normals.rbegin(), rib_normals.rend(), - " \"N\" ", " ", 72); - } - - if (!rib_texcoords.empty()) { - // Per-vertex texcoords. - assert(rib_texcoords.size() == num_verts); - write_long_list(*_output, _indent_level, - rib_texcoords.rbegin(), rib_texcoords.rend(), - " \"st\" ", " ", 72); - } - - if (!rib_colors.empty()) { - assert(rib_colors.size() == num_verts); - - write_long_list(*_output, _indent_level, - rib_colors.rbegin(), rib_colors.rend(), - " \"Cs\" ", " ", 72); - } - - // Clear the arrays for the next primitive. - rib_vertices.clear(); - rib_normals.clear(); - rib_texcoords.clear(); - rib_colors.clear(); -} - - -//////////////////////////////////////////////////////////////////// -// Function: RIBGraphicsStateGuardian::get_color_and_intensity -// Access: Protected, Static -// Description: Given a three-component color value, extracts it into -// a normalized three-component color with each -// component in the range [0..1], and a separate -// intensity value. -//////////////////////////////////////////////////////////////////// -void RIBGraphicsStateGuardian:: -get_color_and_intensity(const RGBColorf &input, - RGBColorf &output, - float &intensity) { - intensity = max(max(input[0], input[1]), input[2]); - if (intensity == 0.0) { - output.set(1.0, 1.0, 1.0); - } else { - output = input / intensity; - } -} - -// type and factory stuff - -GraphicsStateGuardian *RIBGraphicsStateGuardian:: -make_RIBGraphicsStateGuardian(const FactoryParams ¶ms) { - GraphicsStateGuardian::GsgWindow *win_param; - if (!get_param_into(win_param, params)) { - ribgsg_cat.error() - << "No window specified for gsg creation!" << endl; - return NULL; - } - - GraphicsWindow *win = win_param->get_window(); - return new RIBGraphicsStateGuardian(win); -} - -TypeHandle RIBGraphicsStateGuardian::get_type(void) const { - return get_class_type(); -} - -TypeHandle RIBGraphicsStateGuardian::get_class_type(void) { - return _type_handle; -} - -void RIBGraphicsStateGuardian::init_type(void) { - GraphicsStateGuardian::init_type(); - register_type(_type_handle, "RIBGraphicsStateGuardian", - GraphicsStateGuardian::get_class_type()); -} diff --git a/panda/src/ribgsg/ribGraphicsStateGuardian.h b/panda/src/ribgsg/ribGraphicsStateGuardian.h deleted file mode 100644 index 287452400d..0000000000 --- a/panda/src/ribgsg/ribGraphicsStateGuardian.h +++ /dev/null @@ -1,182 +0,0 @@ -// Filename: ribGraphicsStateGuardian.h -// Created by: drose (15Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef RIBGRAPHICSSTATEGUARDIAN_H -#define RIBGRAPHICSSTATEGUARDIAN_H - -#include "pandabase.h" - -#include "graphicsStateGuardian.h" -#include "filename.h" - -class Geom; -class Texture; -class Light; -class Material; -class DisplayRegion; -class RenderBuffer; -class PixelBuffer; -class Fog; - -//////////////////////////////////////////////////////////////////// -// Class : RIBGraphicsStateGuardian -// Description : A GraphicsStateGuardian specialized for creating RIB -// files, suitable for shipping off to a -// Renderman-friendly non-real-time renderer. -//////////////////////////////////////////////////////////////////// -class RIBGraphicsStateGuardian : public GraphicsStateGuardian { -public: - RIBGraphicsStateGuardian(GraphicsWindow *win); - - virtual void reset(); - void reset_file(ostream &out); - void reset_frame(); - - virtual void clear(const RenderBuffer &buffer); - virtual void clear(const RenderBuffer &buffer, const DisplayRegion *region); - - virtual void prepare_display_region(); - - virtual void render_frame(const AllAttributesWrapper &initial_state); - virtual void render_scene(Node *root, ProjectionNode *projnode, - const AllAttributesWrapper &initial_state); - virtual void render_subgraph(RenderTraverser *traverser, - Node *subgraph, ProjectionNode *projnode, - const AllAttributesWrapper &initial_state, - const AllTransitionsWrapper &net_trans); - virtual void render_subgraph(RenderTraverser *traverser, - Node *subgraph, - const AllAttributesWrapper &initial_state, - const AllTransitionsWrapper &net_trans); - - virtual bool wants_normals(void) const; - virtual bool wants_texcoords(void) const; - virtual bool wants_colors(void) const; - - virtual float compute_distance_to(const LPoint3f &point) const; - - virtual void draw_point(const GeomPoint *geom); - virtual void draw_line(const GeomLine *geom); - virtual void draw_linestrip(const GeomLinestrip *) { } - virtual void draw_sprite(const GeomSprite *geom); - virtual void draw_polygon(const GeomPolygon *geom); - virtual void draw_quad(const GeomQuad *geom); - virtual void draw_tri(const GeomTri *geom); - virtual void draw_tristrip(const GeomTristrip *geom); - virtual void draw_trifan(const GeomTrifan *geom); - virtual void draw_sphere(const GeomSphere *geom); - - virtual TextureContext *prepare_texture(Texture *tex); - virtual void apply_texture(TextureContext *tc); - virtual void release_texture(TextureContext *tc); - - virtual void copy_texture(TextureContext *tc, const DisplayRegion *dr); - virtual void copy_texture(TextureContext *tc, const DisplayRegion *dr, - const RenderBuffer &rb); - virtual void draw_texture(TextureContext *tc, const DisplayRegion *dr); - virtual void draw_texture(TextureContext *tc, const DisplayRegion *dr, - const RenderBuffer &rb); - - virtual void texture_to_pixel_buffer(TextureContext *, PixelBuffer *) { } - virtual void texture_to_pixel_buffer(TextureContext *, PixelBuffer *, - const DisplayRegion *) { } - - virtual void copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr); - virtual void copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr, - const RenderBuffer &rb); - virtual void draw_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr, - const NodeAttributes& na=NodeAttributes()); - virtual void draw_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr, - const RenderBuffer &rb, - const NodeAttributes& na=NodeAttributes()); - - virtual void apply_material(Material*) { } - virtual void apply_fog(Fog*) { } - - virtual void apply_light(PointLight*) { } - virtual void apply_light(DirectionalLight*) { } - virtual void apply_light(Spotlight*) { } - virtual void apply_light(AmbientLight*) { } - - virtual void issue_transform(const TransformAttribute *attrib); - virtual void issue_color(const ColorAttribute *attrib); - virtual void issue_texture(const TextureAttribute *attrib); - virtual void issue_light(const LightAttribute *attrib); - - // Normally, these functions are called through the RIBGraphicsWindow. - void set_texture_directory(const string &directory); - string get_texture_directory() const; - void set_texture_extension(const string &extension); - string get_texture_extension() const; - -protected: - virtual PT(SavedFrameBuffer) save_frame_buffer(const RenderBuffer &buffer, - CPT(DisplayRegion) dr); - virtual void restore_frame_buffer(SavedFrameBuffer *frame_buffer); - - void set_color(const RGBColorf &color); - - void get_rib_stuff(Node *root, const AllAttributesWrapper &initial_state); - void define_texture(const Texture *tex); - void define_light(const Light *light); - void write_light_color(const Colorf &color) const; - void write_light_from(const Node *light) const; - void write_light_to(const Node *light) const; - - ostream &new_line(int extra_indent = 0) const; - void reset_transform(const LMatrix4f &mat) const; - void concat_transform(const LMatrix4f &mat) const; - - void draw_simple_poly(const Geom *geom); - void write_polygon(int num_verts); - - static void get_color_and_intensity(const RGBColorf &input, - RGBColorf &output, - float &intensity); - - RGBColorf _current_color; - - string _texture_directory; - string _texture_extension; - ostream *_output; - int _indent_level; - typedef pmap TextureNames; - TextureNames _texture_names; - typedef pmap LightIDs; - LightIDs _light_ids; - typedef pvector EnabledLights; - EnabledLights _enabled_lights; - - -public: - static GraphicsStateGuardian * - make_RIBGraphicsStateGuardian(const FactoryParams ¶ms); - - virtual TypeHandle get_type(void) const; - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - static TypeHandle get_class_type(void); - static void init_type(void); - -private: - static TypeHandle _type_handle; - - friend class RibStuffTraverser; -}; - -#endif - diff --git a/panda/src/ribgsg/ribStuffTraverser.cxx b/panda/src/ribgsg/ribStuffTraverser.cxx deleted file mode 100644 index 01a572665d..0000000000 --- a/panda/src/ribgsg/ribStuffTraverser.cxx +++ /dev/null @@ -1,52 +0,0 @@ -// Filename: ribStuffTraverser.cxx -// Created by: drose (16Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "ribStuffTraverser.h" -#include "ribGraphicsStateGuardian.h" - -#include "textureTransition.h" -#include "lightTransition.h" -#include "geomNode.h" - -//////////////////////////////////////////////////////////////////// -// Function: RibStuffTraverser::reached_node -// Access: Public -// Description: Called for each node of the scene graph; this does -// the work of identifying new things and registering -// them in the RIB file. -//////////////////////////////////////////////////////////////////// -bool RibStuffTraverser:: -reached_node(Node *node, AllTransitionsWrapper &state, NullLevelState &) { - if (node->is_of_type(GeomNode::get_class_type())) { - const TextureTransition *tex_attrib; - if (!get_transition_into(tex_attrib, state)) { - if (tex_attrib->is_on()) { - _gsg->define_texture(tex_attrib->get_texture()); - } - } - - const LightTransition *light_attrib; - if (!get_transition_into(light_attrib, state)) { - LightTransition::const_iterator li; - for (li = light_attrib->begin(); li != light_attrib->end(); ++li) { - _gsg->define_light(*li); - } - } - } - return true; -} diff --git a/panda/src/ribgsg/ribStuffTraverser.h b/panda/src/ribgsg/ribStuffTraverser.h deleted file mode 100644 index 52e5a874ec..0000000000 --- a/panda/src/ribgsg/ribStuffTraverser.h +++ /dev/null @@ -1,48 +0,0 @@ -// Filename: ribStuffTraverser.h -// Created by: drose (16Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef RIBSTUFFTRAVERSER_H -#define RIBSTUFFTRAVERSER_H - -#include "pandabase.h" - -#include "traverserVisitor.h" -#include "renderRelation.h" -#include "allAttributesWrapper.h" -#include "allTransitionsWrapper.h" -#include "nullLevelState.h" - -class RIBGraphicsStateGuardian; - -//////////////////////////////////////////////////////////////////// -// Class : RibStuffTraverser -// Description : -//////////////////////////////////////////////////////////////////// -class RibStuffTraverser : - public TraverserVisitor { -public: - RibStuffTraverser(RIBGraphicsStateGuardian *gsg) : _gsg(gsg) { } - bool reached_node(Node *node, AllAttributesWrapper &state, - NullLevelState &); - -public: - RIBGraphicsStateGuardian *_gsg; -}; - -#endif - diff --git a/panda/src/shader/Sources.pp b/panda/src/shader/Sources.pp deleted file mode 100644 index e8de2abfb6..0000000000 --- a/panda/src/shader/Sources.pp +++ /dev/null @@ -1,37 +0,0 @@ -// This directory is temporarily commented out so I don't have to port -// it to the new attribute-less environment yet. - - -// #define OTHER_LIBS dtoolconfig dtool -// -// #define BUILDING_DLL BUILDING_SHADER -// -// #begin lib_target -// #define TARGET shader -// #define LOCAL_LIBS \ -// putil express display graph sgattrib light sgraphutil -// -// #define COMBINED_SOURCES $[TARGET]_composite1.cxx $[TARGET]_composite2.cxx -// -// #define SOURCES \ -// casterShader.I casterShader.h config_shader.h outlineShader.h \ -// planarReflector.h projtexShader.h projtexShadower.h shader.I \ -// shader.h shaderTransition.I shaderTransition.h \ -// spheretexHighlighter.h spheretexReflector.h \ -// spheretexShader.h spotlightShader.h \ -// -// #define INCLUDED_SOURCES \ -// casterShader.cxx config_shader.cxx outlineShader.cxx \ -// planarReflector.cxx projtexShader.cxx projtexShadower.cxx \ -// shader.cxx shaderTransition.cxx spheretexHighlighter.cxx \ -// spheretexReflector.cxx spheretexShader.cxx \ -// spotlightShader.cxx -// -// #define INSTALL_HEADERS \ -// casterShader.I casterShader.h outlineShader.h planarReflector.h \ -// projtexShader.h projtexShadower.h shader.I shader.h \ -// shaderTransition.I shaderTransition.h spheretexHighlighter.h \ -// spheretexReflector.h spheretexShader.h spotlightShader.h -// -// #end lib_target -// diff --git a/panda/src/shader/casterShader.I b/panda/src/shader/casterShader.I deleted file mode 100644 index 4c36c8557a..0000000000 --- a/panda/src/shader/casterShader.I +++ /dev/null @@ -1,41 +0,0 @@ -// Filename: casterShader.I -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -int CasterShader::add_caster(NamedNode* node) -{ - make_dirty(); - _casters.push_back(node); - return (_casters.size()); -} - -//////////////////////////////////////////////////////////////////// -// Function: CasterShader::remove_caster -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -int CasterShader::remove_caster(NamedNode* node) -{ - make_dirty(); - NamedNodeVector::iterator i; - for (i = _casters.begin(); i != _casters.end(); ++i) { - if ((*i) == node) { - _casters.erase(i); - return true; - } - } - return false; -} diff --git a/panda/src/shader/casterShader.cxx b/panda/src/shader/casterShader.cxx deleted file mode 100644 index b0d9fa4012..0000000000 --- a/panda/src/shader/casterShader.cxx +++ /dev/null @@ -1,23 +0,0 @@ -// Filename: casterShader.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "casterShader.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle CasterShader::_type_handle; diff --git a/panda/src/shader/casterShader.h b/panda/src/shader/casterShader.h deleted file mode 100644 index 98c4b994e9..0000000000 --- a/panda/src/shader/casterShader.h +++ /dev/null @@ -1,79 +0,0 @@ -// Filename: casterShader.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef CASTERSHADER_H -#define CASTERSHADER_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "shader.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : CasterShader -// Description : Frustum Shader that computes effect based on a list -// of "casting" objects -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER CasterShader : public FrustumShader -{ - protected: - - CasterShader(void) : FrustumShader() { } - - public: - - virtual ~CasterShader(void) { } - - INLINE int get_num_casters(void) const { return _casters.size(); } - INLINE int add_caster(NamedNode* node); - INLINE int remove_caster(NamedNode* node); - - typedef pvector NamedNodeVector; - - protected: - - NamedNodeVector _casters; - - public: - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - FrustumShader::init_type(); - register_type(_type_handle, "CasterShader", - FrustumShader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - - private: - - static TypeHandle _type_handle; -}; - -#include "casterShader.I" - -#endif diff --git a/panda/src/shader/config_shader.cxx b/panda/src/shader/config_shader.cxx deleted file mode 100644 index 9cd7b51246..0000000000 --- a/panda/src/shader/config_shader.cxx +++ /dev/null @@ -1,68 +0,0 @@ -// Filename: config_shader.cxx -// Created by: drose (19Mar00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "config_shader.h" -#include "casterShader.h" -#include "outlineShader.h" -#include "planarReflector.h" -#include "projtexShader.h" -#include "projtexShadower.h" -#include "shader.h" -#include "shaderTransition.h" -#include "spheretexHighlighter.h" -#include "spheretexReflector.h" -#include "spheretexShader.h" -#include "spotlightShader.h" - -#include "dconfig.h" - -Configure(config_shader); -NotifyCategoryDef(shader, ""); - -ConfigureFn(config_shader) { - CasterShader::init_type(); - OutlineShader::init_type(); - PlanarReflector::init_type(); - ProjtexShader::init_type(); - ProjtexShadower::init_type(); - Shader::init_type(); - FrustumShader::init_type(); - ShaderTransition::init_type(); - SpheretexHighlighter::init_type(); - SpheretexReflector::init_type(); - SpheretexShader::init_type(); - SpotlightShader::init_type(); - - //Setup shader rendering orders - ShaderTransition::set_shader_order(ProjtexShadower::get_class_type(), 2); - - ShaderTransition::set_shader_order(OutlineShader::get_class_type(), 4); - ShaderTransition::set_shader_order(ProjtexShader::get_class_type(), 4); - ShaderTransition::set_shader_order(SpheretexShader::get_class_type(), 4); - ShaderTransition::set_shader_order(SpotlightShader::get_class_type(), 4); - - ShaderTransition::set_shader_order(SpheretexHighlighter::get_class_type(), 6); - - ShaderTransition::set_shader_order(SpheretexReflector::get_class_type(), 8); - - ShaderTransition::set_shader_order(PlanarReflector::get_class_type(), 10); - - //Tell shaderTransition the shaders that require blending - ShaderTransition::set_shader_always_blend(SpotlightShader::get_class_type()); - ShaderTransition::set_shader_always_blend(SpheretexHighlighter::get_class_type()); -} diff --git a/panda/src/shader/config_shader.h b/panda/src/shader/config_shader.h deleted file mode 100644 index aea1432dbd..0000000000 --- a/panda/src/shader/config_shader.h +++ /dev/null @@ -1,27 +0,0 @@ -// Filename: config_shader.h -// Created by: drose (19Mar00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef CONFIG_SHADER_H -#define CONFIG_SHADER_H - -#include "pandabase.h" -#include "notifyCategoryProxy.h" - -NotifyCategoryDecl(shader, EXPCL_SHADER, EXPTP_SHADER); - -#endif diff --git a/panda/src/shader/outlineShader.cxx b/panda/src/shader/outlineShader.cxx deleted file mode 100644 index 2bd04621c7..0000000000 --- a/panda/src/shader/outlineShader.cxx +++ /dev/null @@ -1,110 +0,0 @@ -// Filename: outlineShader.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "outlineShader.h" -#include "lightTransition.h" -#include "dftraverser.h" -#include "depthTestTransition.h" -#include "graphicsStateGuardian.h" -#include "attribTraverser.h" -#include "renderModeTransition.h" -#include "cullFaceTransition.h" -#include "colorTransition.h" -#include "linesmoothTransition.h" -#include "directRenderTraverser.h" -#include "renderRelation.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle OutlineShader::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: OutlineShader::constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -OutlineShader::OutlineShader(void) : Shader() { - set_color(Colorf(0, 0, 0, 1)); -} - -//////////////////////////////////////////////////////////////////// -// Function: OutlineShader::constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -OutlineShader::OutlineShader(const Colorf &color) : Shader() { - set_color(color); -} - -//////////////////////////////////////////////////////////////////// -// Function: OutlineShader::config -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void OutlineShader::config(void) { - Configurable::config(); -} - -//////////////////////////////////////////////////////////////////// -// Function: OutlineShader::apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void OutlineShader:: -apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) { - Shader::apply(node, init_state, net_trans, gsg); - DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); - - // If the node is un-textured, we need to render it once first (since - // the shader transition won't have drawn it unless it is textured - if (!is_textured(node, init_state)) { - gsg->render_subgraph(&drt, node, init_state, net_trans); - } - - // Copy the transition wrapper so we can modify it freely. - AllTransitionsWrapper trans(net_trans); - - // Turn lighting off - trans.set_transition(new LightTransition(LightTransition::all_off())); - - // Enable line drawing - RenderModeTransition *rm = - new RenderModeTransition(RenderModeProperty::M_wireframe, 2.0); - trans.set_transition(rm); - - // Enable line smooth - // LinesmoothTransition *lsm = new LinesmoothTransition; - // trans.set_transition(lsm); - - // Draw shared edges - DepthTestTransition *dta = - new DepthTestTransition(DepthTestProperty::M_less_equal); - trans.set_transition(dta); - - // Draw back facing edges only - CullFaceTransition *cf = - new CullFaceTransition(CullFaceProperty::M_cull_counter_clockwise); - trans.set_transition(cf); - - // Set the outline color - ColorTransition *c = new ColorTransition(_color); - trans.set_transition(c); - - gsg->render_subgraph(&drt, node, init_state, trans); -} diff --git a/panda/src/shader/outlineShader.h b/panda/src/shader/outlineShader.h deleted file mode 100644 index 76c02a7412..0000000000 --- a/panda/src/shader/outlineShader.h +++ /dev/null @@ -1,70 +0,0 @@ -// Filename: outlineShader.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef OUTILNESHADER_H -#define OUTLINESHADER_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "shader.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : OutlineShader -// Description : -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER OutlineShader : public Shader { -public: - OutlineShader(void); - OutlineShader(const Colorf &color); - ~OutlineShader() { } - - virtual void config(void); - virtual void apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - - INLINE void set_color(const Colorf &color) { _color = color; } - -protected: - Colorf _color; - -public: - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - Shader::init_type(); - register_type(_type_handle, "OutlineShader", - Shader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -private: - static TypeHandle _type_handle; -}; - -#endif diff --git a/panda/src/shader/planarReflector.cxx b/panda/src/shader/planarReflector.cxx deleted file mode 100644 index 3797db1918..0000000000 --- a/panda/src/shader/planarReflector.cxx +++ /dev/null @@ -1,360 +0,0 @@ -// Filename: planarReflector.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "planarReflector.h" -#include "config_shader.h" - -#include "pt_Node.h" -#include "dftraverser.h" -#include "attribTraverser.h" -#include "displayRegion.h" -#include "graphicsWindow.h" -#include "renderBuffer.h" -#include "perspectiveProjection.h" -#include "look_at.h" -#include "get_rel_pos.h" -#include "lightTransition.h" -#include "depthTestTransition.h" -#include "depthWriteTransition.h" -#include "depthWriteTransition.h" -#include "textureTransition.h" -#include "stencilTransition.h" -#include "colorBlendTransition.h" -#include "colorBlendAttribute.h" -#include "cullFaceTransition.h" -#include "transformTransition.h" -#include "colorMaskTransition.h" -#include "colorTransition.h" -#include "clipPlaneTransition.h" -#include "directRenderTraverser.h" -#include "nodeAttributes.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle PlanarReflector::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: PlanarReflector::Constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -PlanarReflector::PlanarReflector(void) : CasterShader() -{ - Colorf c(0.8f, 0.8f, 0.8f, 1.0f); - init(NULL, c); -} - -//////////////////////////////////////////////////////////////////// -// Function: PlanarReflector::Constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -PlanarReflector:: -PlanarReflector(PlaneNode* plane_node) : CasterShader() -{ - Colorf c(0.8f, 0.8f, 0.8f, 1.0f); - init(plane_node, c); -} - -//////////////////////////////////////////////////////////////////// -// Function: PlanarReflector::Constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -PlanarReflector:: -PlanarReflector(const Colorf& c) : CasterShader() -{ - init(NULL, c); -} - -//////////////////////////////////////////////////////////////////// -// Function: PlanarReflector::Constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -PlanarReflector:: -PlanarReflector(PlaneNode* plane_node, const Colorf& c) : CasterShader() -{ - init(plane_node, c); -} - -//////////////////////////////////////////////////////////////////// -// Function: PlanarReflector::init -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void PlanarReflector::init(PlaneNode *plane_node, const Colorf& c) -{ - if (plane_node == NULL) - plane_node = new PlaneNode; - - _save_color_buffer = true; - _save_depth_buffer = true; - _clip_to_plane = true; - - _color_buffer = NULL; - _depth_buffer = NULL; - - _plane_node = plane_node; - _color = c; -} - -//////////////////////////////////////////////////////////////////// -// Function: PlanarReflector::pre_apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void PlanarReflector:: -pre_apply(Node *, const AllAttributesWrapper &, - const AllTransitionsWrapper &, GraphicsStateGuardian *gsg) -{ - int xo, yo, w, h; - gsg->get_current_display_region()->get_region_pixels(xo, yo, w, h); - _color_buffer = new PixelBuffer(PixelBuffer::rgb_buffer(w, h)); - _depth_buffer = new PixelBuffer(PixelBuffer::depth_buffer(w, h)); -} - -//////////////////////////////////////////////////////////////////// -// Function: PlanarReflector::apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void PlanarReflector:: -apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) { - DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); - - Shader::apply(node, init_state, net_trans, gsg); - - init_state.write(shader_cat->debug(false), 4); - - if (get_num_casters() == 0) { - shader_cat.error() - << "PlanarReflector::apply() - no casters in caster list" << endl; - return; - } - - //Due to possible priority problems, make an Off TextureTransition - //with a high priority to ensure that textures are indeed turned of - PT(TextureTransition) tex_off = new TextureTransition(TextureTransition::off()); - tex_off->set_priority(100); - - // If the node is un-textured, we need to render it once first (since - // the shader transition won't have drawn it unless it is textured) - - if (!_multipass_on) { - gsg->render_subgraph(&drt, node, init_state, net_trans); - } - - // Save the stencil buffer clear value for below - bool clear_stencil = gsg->get_stencil_clear_value(); - gsg->set_stencil_clear_value(false); - - { - // Copy the transition wrapper so we can modify it freely. - AllTransitionsWrapper trans(net_trans); - - // Save the current fully-rendered scene that is in the back buffer - int buffer_mask = RenderBuffer::T_stencil; - if (_save_color_buffer) { - gsg->copy_pixel_buffer(_color_buffer, - gsg->get_current_display_region(), - gsg->get_render_buffer(RenderBuffer::T_back)); - buffer_mask |= RenderBuffer::T_back; - - ColorMaskTransition *cm = new ColorMaskTransition(0); - trans.set_transition(cm); - } else { - ColorMaskTransition *cm = - new ColorMaskTransition(ColorMaskProperty::M_a); - trans.set_transition(cm); - } - - if (_save_depth_buffer) - { - gsg->copy_pixel_buffer(_depth_buffer, - gsg->get_current_display_region(), - gsg->get_render_buffer(RenderBuffer::T_depth)); - // gsg->get_render_buffer(RenderBuffer::T_back)); - } - - // The scene has already been rendered so we need to stencil in an area - // on the reflecting plane that is covered by the reflected objects. - - // Turn lighting off - trans.set_transition(new LightTransition(LightTransition::all_off())); - - // Set the depth test to M_equal (? Or should this be M_none?) - DepthTestTransition *dta = - new DepthTestTransition(DepthTestProperty::M_equal); - trans.set_transition(dta); - - // Turn off writes to the depth buffer - DepthWriteTransition *dwa = new DepthWriteTransition; - dwa->set_off(); - trans.set_transition(dwa); - - // Enable the stencil buffer - StencilTransition *sa = - new StencilTransition(StencilProperty::M_not_equal, - StencilProperty::A_replace); - trans.set_transition(sa); - - // Disable texturing - trans.set_transition(tex_off); - - // Disable blending - trans.set_transition(new ColorBlendTransition(ColorBlendProperty::M_none)); - - // Clear the stencil buffer (and color buffer if we're saving it) - gsg->clear(gsg->get_render_buffer(buffer_mask)); - - // Draw the reflecting object - gsg->render_subgraph(&drt, node, init_state, trans); - } - - { - // Reflecting area on the plane has a stencil value of 1. We can now - // draw the reflected objects into this area. - gsg->clear(gsg->get_render_buffer(RenderBuffer::T_depth)); - - // Copy the transition wrapper so we can modify it freely. - AllTransitionsWrapper trans(net_trans); - - // Adjust the stencil buffer properties - StencilTransition *sa = - new StencilTransition(StencilProperty::M_equal, - StencilProperty::A_keep); - trans.set_transition(sa); - - - // Draw back facing polys only - CullFaceTransition *cf = - new CullFaceTransition(CullFaceProperty::M_cull_counter_clockwise); - trans.set_transition(cf); - - if (_clip_to_plane) { - // Clip to the indicated plane. - ClipPlaneTransition *cp = new ClipPlaneTransition; - cp->set_on(_plane_node); - trans.set_transition(cp); - } - - // Reflect objects about the given plane - PT_Node caster_group = new Node; - NamedNodeVector::iterator c; - for (c = _casters.begin(); c != _casters.end(); ++c) { - Node *caster = (*c); - - LMatrix4f mat; - get_rel_mat(caster, _plane_node, mat); - - RenderRelation *arc = new RenderRelation(caster_group, caster); - arc->set_transition(new TransformTransition(mat)); - } - - // Parent this caster group to the node itself, since it's already - // converted to the coordinate space of the node. - PT(RenderRelation) caster_arc = - new RenderRelation(_plane_node, caster_group); - - LMatrix4f plane_mat = _plane_node->get_plane().get_reflection_mat(); - caster_arc->set_transition(new TransformTransition(plane_mat)); - - // Draw the reflected objects - gsg->render_subgraph(&drt, _plane_node, init_state, trans); - - // Remove the caster group from the scene graph. This will also - // delete the temporary group node (since the reference count is - // zero), but not the caster objects themselves. - remove_arc(caster_arc); - } - - { - // Draw the reflecting object once more to modulate the reflected objects - // by the reflectivity color - AllTransitionsWrapper trans(net_trans); - - trans.set_transition(new StencilTransition(StencilProperty::M_none)); - - ColorBlendTransition *cb = - new ColorBlendTransition(ColorBlendProperty::M_multiply); - trans.set_transition(cb); - - ColorTransition *c = new ColorTransition; - c->set_on(_color); - trans.set_transition(c); - - trans.set_transition(new LightTransition(LightTransition::all_off())); - trans.set_transition(tex_off); - - gsg->render_subgraph(&drt, node, init_state, trans); - } - - // Blend the previously rendered image with the reflected image - - if (_save_color_buffer) { - NodeAttributes na; - - ColorBlendAttribute *cb = - new ColorBlendAttribute; - cb->set_mode(ColorBlendProperty::M_add); - na.set_attribute(ColorBlendTransition::get_class_type(), cb); - - gsg->draw_pixel_buffer(_color_buffer, gsg->get_current_display_region(), - gsg->get_render_buffer(RenderBuffer::T_back), na); - } else { - // One more pass to redraw the reflecting object (additive blending) - // Final color is reflecting obj color + (ref. obj. color * reflectivity) - AllTransitionsWrapper trans(net_trans); - - StencilTransition *sa = - new StencilTransition(StencilProperty::M_equal, - StencilProperty::A_keep); - trans.set_transition(sa); - - DepthTestTransition *dta = - new DepthTestTransition(DepthTestProperty::M_equal); - trans.set_transition(dta); - - DepthWriteTransition *dwa = new DepthWriteTransition; - dwa->set_off(); - trans.set_transition(dwa); - - ColorBlendTransition *cb = - new ColorBlendTransition(ColorBlendProperty::M_add); - trans.set_transition(cb); - - gsg->render_subgraph(&drt, node, init_state, trans); - } - - if (_save_depth_buffer) - { - gsg->draw_pixel_buffer(_depth_buffer, gsg->get_current_display_region(), - gsg->get_render_buffer(RenderBuffer::T_depth)); - // gsg->get_render_buffer(RenderBuffer::T_back)); - } - - - // Restore the stencil buffer clear value - gsg->set_stencil_clear_value(clear_stencil); -} - - - - diff --git a/panda/src/shader/planarReflector.h b/panda/src/shader/planarReflector.h deleted file mode 100644 index 8448129db7..0000000000 --- a/panda/src/shader/planarReflector.h +++ /dev/null @@ -1,94 +0,0 @@ -// Filename: planarReflector.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef PLANARREFLECTOR_H -#define PLANARREFLECTOR_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "casterShader.h" -#include "pixelBuffer.h" -#include "planeNode.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : PlanarReflector -// Description : Reflects about a specified plane -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER PlanarReflector : public CasterShader -{ - public: - - PlanarReflector(void); - PlanarReflector(PlaneNode* plane_node); - PlanarReflector(const Colorf& c); - PlanarReflector(PlaneNode* plane_node, const Colorf& c); - - virtual void pre_apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - virtual void apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - - INLINE void set_save_color_buffer(bool val) { _save_color_buffer = val; } - INLINE void set_save_depth_buffer(bool val) { _save_depth_buffer = val; } - INLINE void set_clip_to_plane(bool val) { _clip_to_plane = val; } - INLINE void set_plane_node(PlaneNode* p) { _plane_node = p; } - INLINE void set_color(const Colorf& c) { _color = c; } - - protected: - - void init(PlaneNode* plane_node, const Colorf& c); - - protected: - - bool _save_color_buffer; - bool _save_depth_buffer; - bool _clip_to_plane; - PT(PixelBuffer) _color_buffer; - PT(PixelBuffer) _depth_buffer; - PT(PlaneNode) _plane_node; - Colorf _color; - - public: - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - CasterShader::init_type(); - register_type(_type_handle, "PlanarReflector", - CasterShader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - - private: - - static TypeHandle _type_handle; -}; - -#endif diff --git a/panda/src/shader/projtexShader.cxx b/panda/src/shader/projtexShader.cxx deleted file mode 100644 index 26689459f2..0000000000 --- a/panda/src/shader/projtexShader.cxx +++ /dev/null @@ -1,154 +0,0 @@ -// Filename: projtexShader.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "projtexShader.h" -#include "config_shader.h" - -#include "lightTransition.h" -#include "textureTransition.h" -#include "get_rel_pos.h" -#include "dftraverser.h" -#include "colorBlendTransition.h" -#include "depthTestTransition.h" -#include "graphicsStateGuardian.h" -#include "texGenTransition.h" -#include "texMatrixTransition.h" -#include "perspectiveProjection.h" -#include "attribTraverser.h" -#include "textureApplyTransition.h" -#include "directRenderTraverser.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle ProjtexShader::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: ProjtexShader::constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -ProjtexShader::ProjtexShader(Texture* texture, - ColorBlendProperty::Mode mode) - : FrustumShader(), _blend(mode) -{ - set_texture(texture); -} - -//////////////////////////////////////////////////////////////////// -// Function: ProjtexShader::config -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void ProjtexShader::config(void) -{ - Configurable::config(); - - nassertv(_texture != (Texture *)NULL); -} - -//////////////////////////////////////////////////////////////////// -// Function: ProjtexShader::apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void ProjtexShader:: -apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) { - - Shader::apply(node, init_state, net_trans, gsg); - - // Make sure the shader has been configured properly - if (get_num_frusta() == 0) { - shader_cat.error() - << "ProjtexShader::apply() - frusta list is empty" << endl; - return; - } else if (get_num_frusta() > 1) { - shader_cat.warning() - << "ProjtexShader::apply() - frusta list has more than one " - << "- ignoring all but first one for now..." << endl; - } - - // Copy the transition wrapper so we can modify it freely. - AllTransitionsWrapper trans(net_trans); - - // Create the texture projector transition - // NOTE: If the node being projected upon has its own textures, - // we need to render it first with its own texturing before - // this projected texture pass and then blend the results - LMatrix4f model_mat; - const Projection* projection = _frusta[0]->get_projection(); - get_rel_mat(node, _frusta[0], model_mat); - - // Create the texture generation transition - TexGenTransition *tg = new TexGenTransition; - tg->set_texture_projector(); - trans.set_transition(tg); - // Create the texture transition - nassertv(_texture != (Texture *)NULL); - TextureTransition *t = new TextureTransition; - t->set_on(_texture); - t->set_priority(_priority); - trans.set_transition(t); - - if (_viz != (Shader::Visualize*)0L) - _viz->DisplayTexture(_texture, this); - // Create the texture matrix transition - // Define texture matrix so that object space coords used as - // tex coords will be projected onto the frustum's viewing plane - // An additional scale and translate is required to go from x,y - // NDC coords in [-1,1] to tex coords [0,1] - LMatrix4f tex_mat, proj_mat; - const PerspectiveProjection *pp = DCAST(PerspectiveProjection, projection); - proj_mat = pp->get_projection_mat(); - tex_mat = model_mat * proj_mat * - LMatrix4f::scale_mat(LVector3f(0.5,0.5,1)) * - LMatrix4f::translate_mat(LVector3f(0.5,0.5,0)); - - TexMatrixTransition *tm = new TexMatrixTransition; - tm->set_matrix(tex_mat); - trans.set_transition(tm); - - // Turn lighting off - trans.set_transition(new LightTransition(LightTransition::all_off())); - // Do some extra work if we're doing the 2-pass version (e.g. the - // object we are shading is textured) - if (_multipass_on) { - //Probably should move the brains for determing blending out to - //shader transition - - // Set a color blend mode that assumes this is a second pass over - // textured geometry - ColorBlendTransition *cb = new ColorBlendTransition(_blend); - trans.set_transition(cb); - - TextureApplyTransition *ta = - new TextureApplyTransition(TextureApplyProperty::M_decal); - trans.set_transition(ta); - - // Set the depth test to M_equal (? Or should this be M_none?) - DepthTestTransition *dta = - new DepthTestTransition(DepthTestProperty::M_equal); - trans.set_transition(dta); - } - - DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); - gsg->render_subgraph(&drt, node, init_state, trans); -} - - - diff --git a/panda/src/shader/projtexShader.h b/panda/src/shader/projtexShader.h deleted file mode 100644 index 18f88d5d7d..0000000000 --- a/panda/src/shader/projtexShader.h +++ /dev/null @@ -1,72 +0,0 @@ -// Filename: projtexShader.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef PROJTEXSHADER_H -#define PROJTEXSHADER_H - -#include "pandabase.h" - -#include "shader.h" -#include "texture.h" -#include "colorBlendProperty.h" - - -//////////////////////////////////////////////////////////////////// -// Class : ProjtexShader -// Description : -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER ProjtexShader : public FrustumShader { -public: - ProjtexShader(Texture* texture = NULL, - ColorBlendProperty::Mode mode = ColorBlendProperty::M_multiply); - ~ProjtexShader() { } - - virtual void config(); - virtual void apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - - INLINE void set_texture(Texture* texture) { - _texture = texture; - make_dirty(); - } - - INLINE Texture* get_texture() { return _texture; } - -protected: - PT(Texture) _texture; - ColorBlendProperty::Mode _blend; - -public: - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - FrustumShader::init_type(); - register_type(_type_handle, "ProjtexShader", - FrustumShader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -private: - static TypeHandle _type_handle; -}; - -#endif diff --git a/panda/src/shader/projtexShadower.cxx b/panda/src/shader/projtexShadower.cxx deleted file mode 100644 index e043c80a62..0000000000 --- a/panda/src/shader/projtexShadower.cxx +++ /dev/null @@ -1,259 +0,0 @@ -// Filename: projtexShadower.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "projtexShadower.h" -#include "config_shader.h" - -#include "light.h" -#include "spotlight.h" -#include "renderBuffer.h" -#include "transformTransition.h" -#include "lightTransition.h" -#include "textureTransition.h" -#include "colorBlendTransition.h" -#include "colorTransition.h" -#include "depthTestTransition.h" -#include "depthWriteTransition.h" -#include "polygonOffsetTransition.h" -#include "get_rel_pos.h" -#include "dftraverser.h" -#include "displayRegion.h" -#include "graphicsWindow.h" -#include "directRenderTraverser.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle ProjtexShadower::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: ProjtexShadower::Constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -ProjtexShadower::ProjtexShadower(int size) : CasterShader() -{ - set_size(size); - - Texture* texture = new Texture; - texture->set_minfilter(Texture::FT_linear); - texture->set_magfilter(Texture::FT_linear); - texture->set_wrapu(Texture::WM_clamp); - texture->set_wrapv(Texture::WM_clamp); - texture->_pbuffer->set_xsize(_size); - texture->_pbuffer->set_ysize(_size); - - _projtex_shader = new ProjtexShader(texture, ColorBlendProperty::M_multiply); -} - -//////////////////////////////////////////////////////////////////// -// Function: ProjtexShadower::set_priority -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void ProjtexShadower:: -set_priority(int priority) -{ - Shader::set_priority(priority); - _projtex_shader->set_priority(priority); -} - -//////////////////////////////////////////////////////////////////// -// Function: ProjtexShadower::set_multipass -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void ProjtexShadower:: -set_multipass(bool on) -{ - Shader::set_multipass(on); - _projtex_shader->set_multipass(on); -} - -//////////////////////////////////////////////////////////////////// -// Function: ProjtexShadower::pre_apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void ProjtexShadower:: -pre_apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) -{ - DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); - - int num_lights = 1; - - if (get_num_casters() == 0) { - shader_cat.error() - << "ProjtexShadower::config() - no casters in caster list" << endl; - return; - } - if (get_num_frusta() == 0) { - shader_cat.error() - << "ProjtexShadower::config() - no lights in frusta list" << endl; - return; - } else if (get_num_frusta() > 1) { - shader_cat.warning() - << "ProjtexShadower::config() - frusta list has more than one " - << "frustum - ignore all but the first one for now..." << endl; - num_lights = 1; - } - if (_frusta[0]->get_type() != Spotlight::get_class_type()) { - shader_cat.error() - << "ProjtexShadower::config() - only works for Spotlights" << endl; - return; - } - Spotlight* light = (Spotlight *)_frusta[0]; - - // Save the current display region from the gsg - Colorf clear_color = gsg->get_color_clear_value(); - - // Make sure the projtex shader has the same frustum - _projtex_shader->remove_frustum(light); - _projtex_shader->add_frustum(light); - - // Compute an approximation for the shadow color - Colorf diffuse = light->get_color(); - Colorf shadow_color; - for (int i = 0; i < 4; i++) { - shadow_color[i] = 1.0 / ((diffuse[i] + 1) * num_lights); - } - - nassertv(node != (Node *)NULL && gsg != (GraphicsStateGuardian *)NULL); - - // First, draw the receiving node quickly (with no rendering attributes) - // from the point of view of the light - - // Make a display region of the proper size and clear it to prepare for - // rendering the shadow map - PT(DisplayRegion) disp_region = - gsg->get_window()->make_scratch_display_region(_size, _size); - DisplayRegionStack old_dr = gsg->push_display_region(disp_region); - - // Save scratch region before clearing it to be non-destructive - FrameBufferStack old_fb = gsg->push_frame_buffer - (gsg->get_render_buffer(RenderBuffer::T_back | RenderBuffer::T_depth), - disp_region); - - gsg->set_color_clear_value(Colorf(1., 1., 1., 1.)); - gsg->clear(gsg->get_render_buffer(RenderBuffer::T_back | - RenderBuffer::T_depth), disp_region); - - // Copy the transition wrapper so we can modify it freely. - AllTransitionsWrapper trans(net_trans); - - // Disable lighting, texturing, blending, dithering - trans.set_transition(new LightTransition(LightTransition::all_off())); - //The 100 is to set the priority of this transition high enough - //(hopefully) to turn off any existing texture in the geometry - TextureTransition *t = new TextureTransition(TextureTransition::off()); - t->set_priority(100); - trans.set_transition(t); - trans.set_transition(new ColorBlendTransition(ColorBlendProperty::M_none)); - - - //We need a state that we can modify to remove the camera transform - //that is passed to us - AllAttributesWrapper state(init_state); - state.clear_attribute(TransformTransition::get_class_type()); - - // Render the node with the new transitions from the viewpoint of the light - - gsg->render_subgraph(&drt, node, light, state, trans); - - // Now draw each of the casting objects in the shadow color using the - // depth buffer from the receiving object (this will project the shadows - // onto the surface properly), and use this to generate the shadow texture - // map - - DepthTestTransition *dta = - new DepthTestTransition(DepthTestProperty::M_less); - trans.set_transition(dta); - - DepthWriteTransition *dwa = new DepthWriteTransition; - trans.set_transition(dwa); - - ColorTransition *ca = new ColorTransition(shadow_color); - trans.set_transition(ca); - - // Create a temporary node that is the parent of all of the caster - // objects, so we can render them from the point of view of the - // light. - - PT_Node caster_group = new Node; - NamedNodeVector::iterator ci; - for (ci = _casters.begin(); ci != _casters.end(); ++ci) { - Node *caster = (*ci); - - LMatrix4f mat; - get_rel_mat(caster, node, mat); - - RenderRelation *arc = new RenderRelation(caster_group, caster); - arc->set_transition(new TransformTransition(mat)); - } - - // Parent this caster group to the node itself, since it's already - // converted to the coordinate space of the node - PT(RenderRelation) caster_arc = new RenderRelation(node, caster_group); - - // Now render the group. - gsg->render_subgraph(&drt, caster_group, light, state, trans); - - // Remove the caster group from the scene graph. This will also - // delete the temporary group node (since the reference count is - // zero), but not the caster objects themselves. - remove_arc(caster_arc); - - // Copy the results of the render from the framebuffer into the projtex - // shader's texture - // _projtex_shader->get_texture()->prepare(gsg); - _projtex_shader->get_texture()->copy(gsg, disp_region, gsg->get_render_buffer(RenderBuffer::T_back)); - - // Restore the original display region and clear value - - gsg->set_color_clear_value(clear_color); - gsg->pop_frame_buffer(old_fb); - gsg->pop_display_region(old_dr); -} - -//////////////////////////////////////////////////////////////////// -// Function: ProjtexShadower::apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void ProjtexShadower:: -apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) { - - Shader::apply(node, init_state, net_trans, gsg); - - // Now apply the projected shadow map - _projtex_shader->apply(node, init_state, net_trans, gsg); -} - - - - - - - - - - - - - diff --git a/panda/src/shader/projtexShadower.h b/panda/src/shader/projtexShadower.h deleted file mode 100644 index bcb30a8061..0000000000 --- a/panda/src/shader/projtexShadower.h +++ /dev/null @@ -1,88 +0,0 @@ -// Filename: projtexShadower.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef PROJTEXSHADOWER_H -#define PROJTEXSHADOWER_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "casterShader.h" -#include "projtexShader.h" - -#include "pt_Node.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : ProjtexShadower -// Description : Creates the shadow of a casting object(s) and projects -// it onto a receiving object(s) from a given light -// frustum -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER ProjtexShadower : public CasterShader { -public: - - ProjtexShadower(int size = 256); - - virtual void pre_apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - virtual void apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - - // MPG - should we make this check for powers of 2? - INLINE void set_size(int size) { _size = size; } - INLINE int get_size(void) { return _size; } - - //Override base class shader's set_priority to allow - //us to set the priority of the contained projtex_shader at - //the same time - virtual void set_priority(int priority); - virtual void set_multipass(bool on); - -protected: - - PT(ProjtexShader) _projtex_shader; - int _size; - -public: - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - CasterShader::init_type(); - register_type(_type_handle, "ProjtexShadower", - CasterShader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -private: - - static TypeHandle _type_handle; -}; - -#endif diff --git a/panda/src/shader/shader.I b/panda/src/shader/shader.I deleted file mode 100644 index ff68eed58b..0000000000 --- a/panda/src/shader/shader.I +++ /dev/null @@ -1,61 +0,0 @@ -// Filename: shader.I -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -INLINE Shader:: -Visualize* Shader::get_viz(void) { - return _viz; -} - -//////////////////////////////////////////////////////////////////// -// Function: Shader::set_viz -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -INLINE void Shader:: -set_viz(Shader::Visualize* v) { - _viz = v; -} - -//////////////////////////////////////////////////////////////////// -// Function: FrustumShader::add_frustum -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -INLINE int FrustumShader:: -add_frustum(LensNode* frust) { - make_dirty(); - _frusta.push_back(frust); - return (_frusta.size()); -} - -//////////////////////////////////////////////////////////////////// -// Function: FrustumShader::remove_frustum -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -INLINE int FrustumShader:: -remove_frustum(LensNode* frust) { - make_dirty(); - LensVector::iterator i; - for (i = _frusta.begin(); i != _frusta.end(); ++i) { - if ((*i) == frust) { - _frusta.erase(i); - return true; - } - } - return false; -} diff --git a/panda/src/shader/shader.cxx b/panda/src/shader/shader.cxx deleted file mode 100644 index b08d96e87a..0000000000 --- a/panda/src/shader/shader.cxx +++ /dev/null @@ -1,120 +0,0 @@ -// Filename: shader.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "shader.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle Shader::_type_handle; -TypeHandle FrustumShader::_type_handle; - -Shader::Visualize* Shader::_viz = (Shader::Visualize*)0L; - -//////////////////////////////////////////////////////////////////// -// Function: Shader::Constructor -// Access: Protected -// Description: -//////////////////////////////////////////////////////////////////// -Shader:: -Shader() : Configurable(), _priority(0) { - MemoryUsage::update_type(this, this); -} - -Shader::Visualize::Visualize(void) -{ -} - -Shader::Visualize::~Visualize(void) -{ -} - -void Shader::Visualize::DisplayTexture(PT(Texture)&, Shader*) -{ -} - -void Shader::Visualize::DisplayPixelBuffer(PT(PixelBuffer)&, Shader*) -{ -} - -void Shader::Visualize::Flush(void) -{ -} - -//////////////////////////////////////////////////////////////////// -// Function: Shader::apply -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void Shader:: -apply(Node *, const AllAttributesWrapper &, - const AllTransitionsWrapper &, - GraphicsStateGuardian *) -{ - if (is_dirty()) config(); -} - -//////////////////////////////////////////////////////////////////// -// Function: Shader::pre_apply -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void Shader:: -pre_apply(Node *, const AllAttributesWrapper &, - const AllTransitionsWrapper &, - GraphicsStateGuardian *) -{ -} - -//////////////////////////////////////////////////////////////////// -// Function: Shader::set_priority -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void Shader:: -set_priority(int priority) -{ - _priority = priority; -} - -//////////////////////////////////////////////////////////////////// -// Function: Shader::get_priority -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -int Shader:: -get_priority(void) const -{ - return _priority; -} - - -//////////////////////////////////////////////////////////////////// -// Function: Shader::set_multipass -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void Shader:: -set_multipass(bool on) -{ - _multipass_on = on; -} - - - - - diff --git a/panda/src/shader/shader.h b/panda/src/shader/shader.h deleted file mode 100644 index c5055a9b86..0000000000 --- a/panda/src/shader/shader.h +++ /dev/null @@ -1,153 +0,0 @@ -// Filename: shader.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef SHADER_H -#define SHADER_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "configurable.h" -#include "namedNode.h" -#include "lensNode.h" -#include "typedReferenceCount.h" -#include "graphicsStateGuardian.h" -#include "allAttributesWrapper.h" -#include "allTransitionsWrapper.h" -#include "pointerTo.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : Shader -// Description : Renders an effect on a list of receiving objects -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER Shader : public ReferenceCount, public Configurable -{ -protected: - - Shader(); - - int _priority; - bool _multipass_on; - -public: - - virtual ~Shader(void) { } - - virtual void pre_apply(Node *, const AllAttributesWrapper &, - const AllTransitionsWrapper &, - GraphicsStateGuardian *); - - - virtual void apply(Node *, const AllAttributesWrapper &, - const AllTransitionsWrapper &, - GraphicsStateGuardian *); - - virtual void set_priority(int priority); - virtual int get_priority(void) const; - virtual void set_multipass(bool on); - -public: - - // This is used to visualize partial results, for debugging (and demos) - class EXPCL_SHADER Visualize { - public: - Visualize(void); - virtual ~Visualize(void); - virtual void DisplayTexture(PT(Texture)&, Shader*) = 0; - virtual void DisplayPixelBuffer(PT(PixelBuffer)&, Shader*) = 0; - virtual void Flush(void) = 0; - }; - - static INLINE Visualize* get_viz(void); - static INLINE void set_viz(Visualize*); - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - ReferenceCount::init_type(); - Configurable::init_type(); - register_type(_type_handle, "Shader", - ReferenceCount::get_class_type(), - Configurable::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - - static Visualize* _viz; - -private: - - static TypeHandle _type_handle; -}; - -//////////////////////////////////////////////////////////////////// -// Class : FrustumShader -// Description : Shader that computes effect based on a frustum -// (most often a light or a camera) for a list of -// receiving objects -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER FrustumShader : public Shader -{ -protected: - - FrustumShader(void) : Shader() { } - -public: - - virtual ~FrustumShader(void) { } - - INLINE int get_num_frusta(void) const { return _frusta.size(); } - INLINE int add_frustum(LensNode* frust); - INLINE int remove_frustum(LensNode* frust); - - typedef pvector LensVector; - -protected: - - LensVector _frusta; - -public: - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - Shader::init_type(); - register_type(_type_handle, "FrustumShader", - Shader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - -private: - - static TypeHandle _type_handle; -}; - -#include "shader.I" - -#endif diff --git a/panda/src/shader/shaderTransition.I b/panda/src/shader/shaderTransition.I deleted file mode 100644 index bbc4770ada..0000000000 --- a/panda/src/shader/shaderTransition.I +++ /dev/null @@ -1,80 +0,0 @@ -// Filename: shaderTransition.I -// Created by: drose (24Mar00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::Constructor -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -INLINE ShaderTransition:: -ShaderTransition() { -} - -//////////////////////////////////////////////////////////////////// -// Function: set_shader -// Description: An external function, handy for setting shaders -// directly onto arcs. This will add the indicated -// shader to an existing ShaderTransition, or create a -// new ShaderTransition if necessary. -//////////////////////////////////////////////////////////////////// -INLINE bool -set_shader(NodeRelation *arc, Shader *shader) { - ShaderTransition *st; - if (get_transition_into(st, arc)) { - return st->set_shader(shader); - } - st = new ShaderTransition; - st->set_shader(shader); - arc->set_transition(st); - return true; -} - - -//////////////////////////////////////////////////////////////////// -// Function: clear_shader -// Description: An external function, handy for setting shaders -// directly onto arcs. This will remove the indicated -// shader from the existing ShaderTransition, if there -// is one. -//////////////////////////////////////////////////////////////////// -INLINE bool -clear_shader(NodeRelation *arc, Shader *shader) { - ShaderTransition *st; - if (get_transition_into(st, arc)) { - return st->clear_shader(shader); - } - return false; -} - -//////////////////////////////////////////////////////////////////// -// Function: has_shader -// Description: An external function, handy for setting shaders -// directly onto arcs. This returns true if there -// exists a ShaderTransition and it contains the -// indicated shader, false otherwise. -//////////////////////////////////////////////////////////////////// -INLINE bool -has_shader(const NodeRelation *arc, Shader *shader) { - const ShaderTransition *st; - if (get_transition_into(st, arc)) { - return st->has_shader(shader); - } - return false; -} diff --git a/panda/src/shader/shaderTransition.cxx b/panda/src/shader/shaderTransition.cxx deleted file mode 100644 index c6a96dc156..0000000000 --- a/panda/src/shader/shaderTransition.cxx +++ /dev/null @@ -1,323 +0,0 @@ -// Filename: shaderTransition.cxx -// Created by: mike (06Feb99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "shaderTransition.h" - -#include "indent.h" -#include "graphicsStateGuardian.h" -#include "textureTransition.h" -#include "attribTraverser.h" -#include "directRenderTraverser.h" -#include "renderRelation.h" - -#include "config_shader.h" - -TypeHandle ShaderTransition::_type_handle; -ShaderTransition::ShaderOrder* ShaderTransition::_shader_order = (ShaderTransition::ShaderOrder *)NULL; -ShaderTransition::ShaderBlend* ShaderTransition::_shader_always_blend = (ShaderTransition::ShaderBlend *)NULL; - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::make_copy -// Access: Public, Virtual -// Description: Returns a newly allocated ShaderTransition just like -// this one. -//////////////////////////////////////////////////////////////////// -NodeTransition *ShaderTransition:: -make_copy() const { - return new ShaderTransition(*this); -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::set_shader_order -// Access: Public, Static -// Description: Stores the order "priority" of a shader. (Note, there -// is nothing to prevent you from adding a none shader -// handle type, but it won't really do you any good). -// This order value is used to make sure that multiple -// shaders are ordered in a defined, hopefully -// intelligent order. -//////////////////////////////////////////////////////////////////// -void ShaderTransition:: -set_shader_order(TypeHandle shader, int order) { - if (_shader_order == (ShaderOrder *)NULL) - { - _shader_order = new ShaderOrder; - } - (*_shader_order)[shader] = order; -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::set_shader_blend -// Access: Public, Static -// Description: Some shaders (i.e. spotlight and highlight) need to -// blend with the scene no matter what. -//////////////////////////////////////////////////////////////////// -void ShaderTransition:: -set_shader_always_blend(TypeHandle shader) { - if (_shader_always_blend == (ShaderBlend *)NULL) - { - _shader_always_blend = new ShaderBlend; - } - _shader_always_blend->insert(shader); -} - - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::clear -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void ShaderTransition:: -clear() { - _shaders.clear(); -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::is_empty -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -bool ShaderTransition:: -is_empty() const { - return _shaders.empty(); -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::insert -// Access: Public -// Description: Inserts the shader into the list, based -// on the set order of the list. If there is no order set for -// the shader, it is put at the end of the list. -//////////////////////////////////////////////////////////////////// -void ShaderTransition:: -insert(Shader *shader) { - PT(Shader) sp(shader); - Shaders::iterator si = _shaders.begin(); - int order = -1; - - if ((_shader_order == NULL) && (_overrides.find(sp) == _overrides.end())) - { - si = _shaders.end(); - } - - if (_overrides.find(sp) != _overrides.end()) - { - order = _overrides[sp]; - } - else if (_shader_order->find(sp->get_type()) != _shader_order->end()) - { - order = (*_shader_order)[sp->get_type()]; - } - - if (order == -1) - { - si = _shaders.end(); - } - - while(si != _shaders.end()) - { - if (_overrides.find((*si)) != _overrides.end()) - { - if (order < _overrides[(*si)]) - { - break; - } - } - else if (order < (*_shader_order)[(*si)->get_type()]) - { - break; - } - si++; - } - - _shaders.insert(si, shader); -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::set_shader -// Access: Public -// Description: Adds the shader to the transition, if it is not -// already there. Returns true if the shader was added, -// false if it was there already. If the shader *was* -// already on the list, it is moved to the end of the -// list. -//////////////////////////////////////////////////////////////////// -bool ShaderTransition:: -set_shader(Shader *shader, int override) { - // We need to search for a PT(Shader), not a Shader* . - PT(Shader) sp(shader); - - if (override != -1) - { - _overrides[sp] = override; - } - - Shaders::iterator si = find(_shaders.begin(), _shaders.end(), sp); - if (si != _shaders.end()) { - // The shader was there already; move it to the end. - return false; - } - insert(shader); - return true; -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::clear_shader -// Access: Public -// Description: Removes the first occurrence of the indicated shader -// from the list, and returns true if anything was -// removed, false if there were no occurrences. -//////////////////////////////////////////////////////////////////// -bool ShaderTransition:: -clear_shader(Shader *shader) { - // We need to search for a PT(Shader), not a Shader* . - PT(Shader) sp(shader); - Shaders::iterator si = find(_shaders.begin(), _shaders.end(), sp); - if (si != _shaders.end()) { - _shaders.erase(si); - return true; - } - return false; -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::has_shader -// Access: Public -// Description: Returns true if the indicated shader appears on the -// list, false otherwise. -//////////////////////////////////////////////////////////////////// -bool ShaderTransition:: -has_shader(Shader *shader) const { - // We need to search for a PT(Shader), not a Shader* . - PT(Shader) sp(shader); - Shaders::const_iterator si = find(_shaders.begin(), _shaders.end(), sp); - return (si != _shaders.end()); -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::begin -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -ShaderTransition::const_iterator ShaderTransition:: -begin() const { - return _shaders.begin(); -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::end -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -ShaderTransition::const_iterator ShaderTransition:: -end() const { - return _shaders.end(); -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::must_blend -// Access: Public -// Description: Checks to see if one of the shaders on the shaderTransition -// is a kind that requires blending -//////////////////////////////////////////////////////////////////// -bool ShaderTransition:: -must_blend() -{ - const_iterator si; - for(si = begin(); si != end(); si++) - { - if (_shader_always_blend->find((*si)->get_type()) != _shader_always_blend->end()) - { - return true; - } - } - - return false; -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::sub_render -// Access: Public, Virtual -// Description: This is called by the RenderTraverser to tell the -// shader to do its thing. -//////////////////////////////////////////////////////////////////// -bool ShaderTransition:: -sub_render(NodeRelation *arc, const AllAttributesWrapper &attrib, - AllTransitionsWrapper &trans, RenderTraverser *trav) { - Node *node = arc->get_child(); - GraphicsStateGuardian *gsg = trav->get_gsg(); - bool multipass_on = false; - - // No shaders; never mind. - if (is_empty()) { - return true; - } - - AllAttributesWrapper node_attrib; - node_attrib.apply_from(attrib, trans); - - multipass_on = must_blend() | is_textured(node, node_attrib) | - is_shaded(node) | (_shaders.size() > 1); - - const_iterator si; - // In order to avoid strange nasty looking artifacts due to(?) the - // depth buffer not being restored properly when we employ scratch - // display regions. Call pre-apply before the scene has been - // rendered. Any shader that uses a scratch region will do it's - // thing and then when the scene is actually rendered, it will blow - // those artifacts away. Those shaders will store their work to be - // actually applied later when we call apply. - for (si = begin(); si != end(); ++si) - { - // We'll go ahead and tell each shader in turn if multipass is - // needed or not now. - (*si)->set_multipass(multipass_on); - (*si)->pre_apply(node, node_attrib, AllTransitionsWrapper(), gsg); - } - - if ( multipass_on ) - { - // Multipass is needed at this point. Render the node with its normal - // attributes (including texturing). - DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); - gsg->render_subgraph(&drt, node, node_attrib, AllTransitionsWrapper()); - } - - // Now apply each shader in turn. - for (si = begin(); si != end(); ++si) - { - (*si)->apply(node, node_attrib, AllTransitionsWrapper(), gsg); - } - - return false; -} - -//////////////////////////////////////////////////////////////////// -// Function: ShaderTransition::has_sub_render -// Access: Public, Virtual -// Description: Should be redefined to return true if the function -// sub_render(), above, expects to be called during -// traversal. -//////////////////////////////////////////////////////////////////// -bool ShaderTransition:: -has_sub_render() const { - return true; -} - - - diff --git a/panda/src/shader/shaderTransition.h b/panda/src/shader/shaderTransition.h deleted file mode 100644 index 1e5f1886fb..0000000000 --- a/panda/src/shader/shaderTransition.h +++ /dev/null @@ -1,122 +0,0 @@ -// Filename: shaderTransition.h -// Created by: mike (19Jan99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#ifndef SHADERTRANSITION_H -#define SHADERTRANSITION_H - -#include "pandabase.h" - -#include "shader.h" - -#include "immediateTransition.h" -#include "pointerTo.h" -#include "nodeRelation.h" - -#include "plist.h" -#include "pmap.h" -#include "pset.h" - -//////////////////////////////////////////////////////////////////// -// Class : ShaderTransition -// Description : A ShaderTransition holds the set of shaders that -// might be in effect to render a particular part of the -// subgraph. These shaders can range from lightweight -// rendering effects to full-blown multipass renderings; -// use with caution. -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER ShaderTransition : public ImmediateTransition { -private: - // typedef pvector< PT(Shader) > Shaders; - typedef plist< PT(Shader) > Shaders; - typedef pmap ShaderOrder; - typedef pmap ShaderOverride; - typedef pset ShaderBlend; - -public: - INLINE ShaderTransition(); - -public: - // Functions to access and adjust the list of shaders. - typedef Shaders::const_iterator iterator; - typedef Shaders::const_iterator const_iterator; - - void clear(); - bool is_empty() const; - void insert(Shader *shader); - - //If you wish to override the ordering of your shader. Say for some - //reason you don't want this Shadow to appear in the reflections, or you want - //Spheremaped objects to reflect the reflections in planar objects instead of - //the other way around. Then set override appropriately. - bool set_shader(Shader *shader, int override = -1); - bool clear_shader(Shader *shader); - bool has_shader(Shader *shader) const; - - const_iterator begin() const; - const_iterator end() const; - -public: - static void set_shader_order(TypeHandle shader, int order); - static void set_shader_always_blend(TypeHandle shader); - -private: - bool must_blend(); - -public: - virtual NodeTransition *make_copy() const; - - virtual bool sub_render(NodeRelation *arc, - const AllTransitionsWrapper &input_trans, - AllTransitionsWrapper &modify_trans, - RenderTraverser *trav); - virtual bool has_sub_render() const; - -private: - Shaders _shaders; - static ShaderOrder* _shader_order; - static ShaderBlend* _shader_always_blend; - ShaderOverride _overrides; - -public: - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - ImmediateTransition::init_type(); - register_type(_type_handle, "ShaderTransition", - ImmediateTransition::get_class_type()); - } - -private: - static TypeHandle _type_handle; - friend class ShaderAttribute; -}; - -INLINE bool set_shader(NodeRelation *arc, Shader *shader); -INLINE bool clear_shader(NodeRelation *arc, Shader *shader); -INLINE bool has_shader(const NodeRelation *arc, Shader *shader); - -#include "shaderTransition.I" - -#endif - - diff --git a/panda/src/shader/shader_composite1.cxx b/panda/src/shader/shader_composite1.cxx deleted file mode 100644 index 7e26c8c863..0000000000 --- a/panda/src/shader/shader_composite1.cxx +++ /dev/null @@ -1,7 +0,0 @@ - -#include "casterShader.cxx" -#include "config_shader.cxx" -#include "planarReflector.cxx" -#include "projtexShader.cxx" -#include "projtexShadower.cxx" -#include "spotlightShader.cxx" diff --git a/panda/src/shader/shader_composite2.cxx b/panda/src/shader/shader_composite2.cxx deleted file mode 100644 index f02d5f82aa..0000000000 --- a/panda/src/shader/shader_composite2.cxx +++ /dev/null @@ -1,8 +0,0 @@ - -#include "shader.cxx" -#include "outlineShader.cxx" -#include "shaderTransition.cxx" -#include "spheretexHighlighter.cxx" -#include "spheretexReflector.cxx" -#include "spheretexShader.cxx" - diff --git a/panda/src/shader/spheretexHighlighter.cxx b/panda/src/shader/spheretexHighlighter.cxx deleted file mode 100644 index ffcb864634..0000000000 --- a/panda/src/shader/spheretexHighlighter.cxx +++ /dev/null @@ -1,185 +0,0 @@ -// Filename: spheretexHighlighter.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "spheretexHighlighter.h" -#include "config_shader.h" - -#include "light.h" -#include "spotlight.h" -#include "renderBuffer.h" -#include "get_rel_pos.h" -#include "dftraverser.h" -#include "displayRegion.h" -#include "graphicsWindow.h" -#include "materialTransition.h" -#include "materialAttribute.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle SpheretexHighlighter::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexHighlighter::Constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -SpheretexHighlighter::SpheretexHighlighter(int size) : FrustumShader() -{ - set_size(size); - - Texture* texture = new Texture; - texture->set_minfilter(Texture::FT_linear); - texture->set_magfilter(Texture::FT_linear); - texture->set_wrapu(Texture::WM_clamp); - texture->set_wrapv(Texture::WM_clamp); - texture->_pbuffer = new PixelBuffer(PixelBuffer::rgb_buffer(_size, _size)); - _spheretex_shader.set_texture(texture); - _spheretex_shader.set_blend_mode(ColorBlendProperty::M_add); -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexHighlighter::set_multipass -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexHighlighter:: -set_multipass(bool) -{ - //A highlight shader always needs to blend - _multipass_on = true; - _spheretex_shader.set_multipass(true); -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexHighlighter::set_priority -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexHighlighter:: -set_priority(int priority) -{ - Shader::set_priority(priority); - _spheretex_shader.set_priority(priority); -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexHighlighter::pre_apply -// Access: -// Description: -/////////////////////////////////////////////////////////////////// -void SpheretexHighlighter:: -pre_apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &, GraphicsStateGuardian *gsg) -{ - if (get_num_frusta() == 0) { - shader_cat.error() - << "SpheretexHighlighter::config() - no lights in frusta list" - << endl; - return; - } else if (get_num_frusta() > 1) { - shader_cat.warning() - << "SpheretexHighlighter::config() - frusta list has more than one " - << "frustum - ignore all but the first one for now..." << endl; - } - if (_frusta[0]->get_type() != Spotlight::get_class_type()) { - shader_cat.error() - << "SpheretexHighlighter::config() - only works for Spotlights" - << " so far - we'll add point lights later" << endl; - return; - } - // MPG - we could make this work for point lights as well - Spotlight* light = (Spotlight *)_frusta[0]; - - // Figure out how shiny the highlighted object is - float shininess = 0.0; - - const NodeAttribute *mat_attrib = - init_state.get_attribute(MaterialTransition::get_class_type()); - if (mat_attrib != (NodeAttribute *)NULL) { - const Material *material = - DCAST(MaterialAttribute, mat_attrib)->get_material(); - shininess = material->get_shininess(); - } - - if (shininess == 0.0) { - shininess = 100.0; - } - - // Figure out where the highlight is relative to the object's center and - // the light - const LensNode* projnode = gsg->get_current_camera(); - LVector3f model_pos = get_rel_pos(node, projnode); - LVector3f norm_model_pos = normalize(model_pos); - LPoint3f light_pos = get_rel_pos(light, projnode); - LVector3f light_vec = light_pos - model_pos; - light_vec = normalize(light_vec); - - // Compute highlight for all pixels on the image that are on the sphere - LVector3f view_vec(0, -1, 0); // Looking down +y axis - LVector3f norm, S; - float ZZ, XX_ZZ, intensity, grazing; - uchar color[3]; - float scale = 1.0 / ((float)(_size - 1)); - - Texture* texture = _spheretex_shader.get_texture(); - - for (int y = 0; y < _size; ++y) { - norm[2] = 2. * ((float)y * scale) - 1.; // 0.._size-1 -> -1..1 - ZZ = norm[2] * norm[2]; // z^2 - - for (int x = 0; x < _size; ++x) { - norm[0] = 2. * ((float)x * scale) -1.; // 0.._size-1 -> -1..1 - XX_ZZ = (norm[0] * norm[0]) + ZZ; // x^2 + z^2 - - color[0] = color[1] = color[2] = 0; - - if (XX_ZZ <= 1.) { // Are we on the unit sphere? - norm[1] = -(float)sqrt(1. - XX_ZZ); // This yields a unit vector - grazing = dot(norm, light_vec); - if (grazing > 0.) { // Does any light actually reflect off this point? - S = norm; - S *= 2. * grazing; - S = S - light_vec; // the reflection vector - intensity = -dot(S, norm_model_pos); // approximate R . V - // If, relative to the viewer, the normal doesn't point towards the - // light (even slightly), no reflection will be seen - if (intensity > 0.) { - intensity = pow(intensity, shininess); - color[0] = color[1] = color[2] = (uchar)(intensity * 255.); - } - } - } - texture->_pbuffer->set_uchar_rgb_texel(color, x, y, _size); - texture->unprepare(); - } - } -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexHighlighter::apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexHighlighter:: -apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) { - - Shader::apply(node, init_state, net_trans, gsg); - - _spheretex_shader.apply(node, init_state, net_trans, gsg); -} diff --git a/panda/src/shader/spheretexHighlighter.h b/panda/src/shader/spheretexHighlighter.h deleted file mode 100644 index 486d426763..0000000000 --- a/panda/src/shader/spheretexHighlighter.h +++ /dev/null @@ -1,87 +0,0 @@ -// Filename: spheretexHighlighter.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef SPHERETEXHIGHLIGHTER_H -#define SPHERETEXHIGHLIGHTER_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "shader.h" -#include "spheretexShader.h" - -#include "pt_Node.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : SpheretexHighlighter -// Description : Creates a highlight texture from a given light and -// projects this onto the receiving object -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER SpheretexHighlighter : public FrustumShader -{ -public: - - SpheretexHighlighter(int size = 128); - - virtual void pre_apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - virtual void apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - - // MPG - should we make this check for powers of 2? - INLINE void set_size(int size) { _size = size; } - INLINE int get_size(void) { return _size; } - //Override base class shader's set_priority to allow - //us to set the priority of the contained projtex_shader at - //the same time - virtual void set_priority(int priority); - virtual void set_multipass(bool on); - -protected: - - SpheretexShader _spheretex_shader; - int _size; - -public: - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - FrustumShader::init_type(); - register_type(_type_handle, "SpheretexHighlighter", - FrustumShader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -private: - - static TypeHandle _type_handle; -}; - -#endif diff --git a/panda/src/shader/spheretexReflector.cxx b/panda/src/shader/spheretexReflector.cxx deleted file mode 100644 index 5f0e839a85..0000000000 --- a/panda/src/shader/spheretexReflector.cxx +++ /dev/null @@ -1,234 +0,0 @@ -// Filename: spheretexReflector.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "spheretexReflector.h" -#include "config_shader.h" - -#include "pt_Node.h" -#include "frustum.h" -#include "get_rel_pos.h" -#include "dftraverser.h" -#include "displayRegion.h" -#include "graphicsWindow.h" -#include "renderBuffer.h" -#include "perspectiveLens.h" -#include "look_at.h" -#include "cullFaceTransition.h" -#include "colorBlendTransition.h" -#include "transformTransition.h" -#include "directRenderTraverser.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle SpheretexReflector::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexReflector::Constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -SpheretexReflector::SpheretexReflector(int size) : CasterShader() -{ - set_size(size); - _is_reflector = true; - - _fnear = 0.1f; - _ffar = 1000.0f; - - Texture* texture = new Texture; - texture->set_minfilter(Texture::FT_linear); - texture->set_magfilter(Texture::FT_linear); - texture->set_wrapu(Texture::WM_clamp); - texture->set_wrapv(Texture::WM_clamp); - texture->_pbuffer->set_xsize(_size); - texture->_pbuffer->set_ysize(_size); - - _spheretex_shader.set_texture(texture); - _spheretex_shader.set_blend_mode(ColorBlendProperty::M_add); -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexReflector::destructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -SpheretexReflector::~SpheretexReflector(void) { -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexReflector::set_priority -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexReflector:: -set_priority(int priority) -{ - Shader::set_priority(priority); - _spheretex_shader.set_priority(priority); -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexReflector::set_multipass -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexReflector:: -set_multipass(bool on) -{ - Shader::set_multipass(on); - _spheretex_shader.set_multipass(on); -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexHighlighter::pre_apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexReflector:: -pre_apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) -{ - if (get_num_casters() == 0) { - shader_cat.error() - << "SpheretexReflector::config() - no casters in caster list" << endl; - return; - } - - //We need a state that we can modify to remove the camera transform - //that is passed to us - AllAttributesWrapper state(init_state); - state.clear_attribute(TransformTransition::get_class_type()); - - // Get the current camera from the gsg - const LensNode* camera = gsg->get_current_camera(); - - // Save the clear color. - Colorf clear_color = gsg->get_color_clear_value(); - - // Make a display region of the proper size and clear it to prepare for - // rendering the shadow map - PT(DisplayRegion) scratch_region = - gsg->get_window()->make_scratch_display_region(_size, _size); - - DisplayRegionStack old_dr = gsg->push_display_region(scratch_region); - - // Save scratch region before clearing it to be non-destructive - FrameBufferStack old_fb = gsg->push_frame_buffer - (gsg->get_render_buffer(RenderBuffer::T_back | RenderBuffer::T_depth), - scratch_region); - - gsg->set_color_clear_value(Colorf(0., 0., 0., 1.)); - gsg->clear(gsg->get_render_buffer(RenderBuffer::T_back | - RenderBuffer::T_depth), scratch_region); - - // Copy the transition wrapper so we can modify it freely. - AllTransitionsWrapper trans(net_trans); - - // Create a temporary node that is the parent of all of the caster - // objects, so we can render them from the point of view of the - // reflector. - - PT_Node caster_group = new Node; - NamedNodeVector::iterator ci; - for (ci = _casters.begin(); ci != _casters.end(); ++ci) { - Node *caster = (*ci); - - // Get the transform of the caster from the point of view of the - // reflector. - LMatrix4f mat; - get_rel_mat(caster, node, mat); - - RenderRelation *arc = new RenderRelation(caster_group, caster); - arc->set_transition(new TransformTransition(mat)); - } - - // Build a LensNode that represents a wide-angle view from the - // reflecting object towards the camera. - PT(Lens) *lens = new PerspectiveLens; - lens->set_fov(150.0f); - lens->set_near(_fnear); - lens->set_far(_ffar); - LensNode *projnode = new LensNode; - projnode->set_lens(lens); - - // How shall we rotate the LensNode? - LMatrix4f r_mat; - - // Get camera pos in the coordinate space of the reflecting object - LVector3f camera_pos = get_rel_pos(camera, node); - LVector3f camera_up = get_rel_up(camera, node); - if (_is_reflector == true) - { - // Take the picture looking toward the camera - look_at(r_mat, camera_pos, camera_up, gsg->get_coordinate_system()); - - // Flip along the X axis to make it behave like a mirror - r_mat = LMatrix4f::scale_mat(LVector3f(-1.0f, 1.0f, 1.0f)) * r_mat; - - // And the vertex order for front facing polygons to compensate - // for the above flip. - CullFaceTransition *cf = - new CullFaceTransition(CullFaceProperty::M_cull_counter_clockwise); - trans.set_transition(cf); - } - else - { - // For a refractor, take the picture looking away from the camera. - look_at(r_mat, -camera_pos, camera_up, gsg->get_coordinate_system()); - } - - RenderRelation *projarc = new RenderRelation(caster_group, projnode); - projarc->set_transition(new TransformTransition(r_mat)); - - // Now render the casters. - DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); - gsg->render_subgraph(&drt, caster_group, projnode, state, trans); - - // The caster group, and all of the temporary group nodes below, - // will automatically be destructed when the caster_group PointerTo - // object goes out of scope. We don't have to remove it from the - // scene graph because we never actually inserted it. - - // Copy the results of the render from the framebuffer into the spheretex - // shader's texture - _spheretex_shader.get_texture()->copy(gsg, scratch_region, gsg->get_render_buffer(RenderBuffer::T_back)); - - // Restore the original display region and clear value - - //Make sure the restore the depth buffer. There's only one you know. - - gsg->set_color_clear_value(clear_color); - gsg->pop_frame_buffer(old_fb); - gsg->pop_display_region(old_dr); -} -//////////////////////////////////////////////////////////////////// -// Function: SpheretexHighlighter::apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexReflector:: -apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) - { - Shader::apply(node, init_state, net_trans, gsg); - - // Apply the spheremap reflection - //gsg->prepare_display_region(); - _spheretex_shader.apply(node, init_state, net_trans, gsg); -} - diff --git a/panda/src/shader/spheretexReflector.h b/panda/src/shader/spheretexReflector.h deleted file mode 100644 index 6375cebabb..0000000000 --- a/panda/src/shader/spheretexReflector.h +++ /dev/null @@ -1,99 +0,0 @@ -// Filename: spheretexReflector.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef SPHERETEXREFLECTOR_H -#define SPHERETEXREFLECTOR_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "shader.h" -#include "spheretexShader.h" -#include "casterShader.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : SpheretexReflector -// Description : Creates a reflection texture map for a given object -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER SpheretexReflector : public CasterShader -{ -public: - - SpheretexReflector(int size = 256); - ~SpheretexReflector(void); - - virtual void pre_apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - virtual void apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - - // MPG - should we make this check for powers of 2? - INLINE void set_size(int size) { _size = size; } - INLINE int get_size(void) const { return _size; } - - INLINE bool is_reflector(void) const { return _is_reflector; } - INLINE void make_reflector(void) { _is_reflector = true; } - INLINE void make_refractor(void) { _is_reflector = false; } - - INLINE void set_near(float fnear) { _fnear = fnear; } - INLINE float get_near(void) const { return _fnear; } - INLINE void set_far(float ffar) { _ffar = ffar; } - INLINE float get_far(void) const { return _ffar; } - - //Override base class shader's set_priority to allow - //us to set the priority of the contained projtex_shader at - //the same time - virtual void set_priority(int priority); - virtual void set_multipass(bool on); - -protected: - - SpheretexShader _spheretex_shader; - int _size; - bool _is_reflector; - float _fnear; - float _ffar; - -public: - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - CasterShader::init_type(); - register_type(_type_handle, "SpheretexReflector", - CasterShader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -private: - - static TypeHandle _type_handle; -}; - -#endif diff --git a/panda/src/shader/spheretexShader.cxx b/panda/src/shader/spheretexShader.cxx deleted file mode 100644 index c69de81d6c..0000000000 --- a/panda/src/shader/spheretexShader.cxx +++ /dev/null @@ -1,131 +0,0 @@ -// Filename: spheretexShader.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "spheretexShader.h" -#include "config_shader.h" - -#include "lightTransition.h" -#include "textureTransition.h" -#include "textureTransition.h" -#include "texMatrixTransition.h" -#include "depthTestTransition.h" -#include "texGenTransition.h" -#include "textureApplyTransition.h" -#include "colorBlendTransition.h" -#include "get_rel_pos.h" -#include "dftraverser.h" -#include "graphicsStateGuardian.h" -#include "colorBlendTransition.h" -#include "attribTraverser.h" -#include "directRenderTraverser.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle SpheretexShader::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexShader::constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -SpheretexShader::SpheretexShader(Texture* texture) : Shader() -{ - set_texture(texture); - _blend_mode = ColorBlendProperty::M_multiply_add; -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexShader::config -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexShader::config(void) -{ - Configurable::config(); - - nassertv(_texture != (Texture *)NULL); - _texture->set_minfilter(Texture::FT_linear); - _texture->set_magfilter(Texture::FT_linear); - _texture->set_wrapu(Texture::WM_clamp); - _texture->set_wrapv(Texture::WM_clamp); -} - -//////////////////////////////////////////////////////////////////// -// Function: SpheretexShader::apply -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void SpheretexShader:: -apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, GraphicsStateGuardian *gsg) { - - Shader::apply(node, init_state, net_trans, gsg); - - // Copy the transition wrapper so we can modify it freely. - AllTransitionsWrapper trans(net_trans); - - // Create the texture generation transition - TexGenTransition *tg = new TexGenTransition; - tg->set_sphere_map(); - trans.set_transition(tg); - - // Create the texture transition - nassertv(_texture != (Texture *)NULL); - TextureTransition *t = new TextureTransition; - t->set_on(_texture); - t->set_priority(_priority); - trans.set_transition(t); - - if (_viz != (Shader::Visualize*)0L) - _viz->DisplayTexture(_texture, this); - - // Clear the texture matrix transition - trans.set_transition(new TexMatrixTransition(LMatrix4f::ident_mat())); - - // Turn lighting off - we still want to issue normals, though - trans.set_transition(new LightTransition(LightTransition::all_off())); - gsg->force_normals(); - - // Do some extra work if we're doing the 2-pass version (e.g. the - // object we are shading is textured) - if (_multipass_on) { - // Set a color blend mode that assumes this is a second pass over - // textured geometry - ColorBlendTransition *cb = - new ColorBlendTransition(_blend_mode); - trans.set_transition(cb); - - TextureApplyTransition *ta = - new TextureApplyTransition(TextureApplyProperty::M_decal); - trans.set_transition(ta); - - // Set the depth test to M_equal (? Or should this be M_none?) - DepthTestTransition *dta = - new DepthTestTransition(DepthTestProperty::M_equal); - trans.set_transition(dta); - } - - // Render the node with the new transitions. - DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); - gsg->render_subgraph(&drt, node, init_state, trans); - - gsg->undo_force_normals(); -} - - - diff --git a/panda/src/shader/spheretexShader.h b/panda/src/shader/spheretexShader.h deleted file mode 100644 index 19a9f52ee3..0000000000 --- a/panda/src/shader/spheretexShader.h +++ /dev/null @@ -1,84 +0,0 @@ -// Filename: spheretexShader.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef SPHERETEXSHADER_H -#define SPHERETEXSHADER_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "shader.h" -#include "texture.h" -#include "colorBlendTransition.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : SpheretexShader -// Description : -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER SpheretexShader : public Shader -{ - public: - - SpheretexShader(Texture* texture = NULL); - ~SpheretexShader() { } - - virtual void config(void); - virtual void apply(Node *node, const AllAttributesWrapper &init_state, - const AllTransitionsWrapper &net_trans, - GraphicsStateGuardian *gsg); - - INLINE void set_texture(Texture* texture) { - _texture = texture; - make_dirty(); - } - INLINE Texture* get_texture(void) { return _texture; } - INLINE void set_blend_mode(ColorBlendProperty::Mode mode) { - _blend_mode = mode; - } - - protected: - - PT(Texture) _texture; - ColorBlendProperty::Mode _blend_mode; - - public: - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - Shader::init_type(); - register_type(_type_handle, "SpheretexShader", - Shader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - - private: - - static TypeHandle _type_handle; -}; - -#endif diff --git a/panda/src/shader/spotlightShader.cxx b/panda/src/shader/spotlightShader.cxx deleted file mode 100644 index 983fb4ba7a..0000000000 --- a/panda/src/shader/spotlightShader.cxx +++ /dev/null @@ -1,76 +0,0 @@ -// Filename: spotlightShader.cxx -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#include "spotlightShader.h" -#include "config_shader.h" - -#include "spotlight.h" - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// -TypeHandle SpotlightShader::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: SpotlightShader::constructor -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -SpotlightShader::SpotlightShader(int size, float radius) : ProjtexShader(NULL, ColorBlendProperty::M_multiply_add) -{ - Texture* texture = new Texture; - texture->set_minfilter(Texture::FT_linear); - texture->set_magfilter(Texture::FT_linear); - texture->set_wrapu(Texture::WM_clamp); - texture->set_wrapv(Texture::WM_clamp); - texture->_pbuffer = new PixelBuffer(PixelBuffer::rgb_buffer(size, size)); - set_texture(texture); - _radius = radius; -} - -//////////////////////////////////////////////////////////////////// -// Function: SpotlightShader::config -// Access: -// Description: -//////////////////////////////////////////////////////////////////// -void SpotlightShader::config(void) -{ - Configurable::config(); - - if (get_num_frusta() == 0) { - shader_cat.error() - << "SpotlightShader::config() - no lights in frusta list" << endl; - return; - } else if (get_num_frusta() > 1) { - shader_cat.warning() - << "SpotlightShader::config() - frusta list has more than one " - << "frustum - ignore all but the first one for now..." << endl; - } - if (_frusta[0]->get_type() != Spotlight::get_class_type()) { - shader_cat.error() - << "SpotlightShader::config() - frusta is not a spotlight" << endl; - return; - } - Spotlight* spotlight = (Spotlight *)_frusta[0]; - - spotlight->make_image(_texture, _radius); -} - - - - - diff --git a/panda/src/shader/spotlightShader.h b/panda/src/shader/spotlightShader.h deleted file mode 100644 index f73ad707bf..0000000000 --- a/panda/src/shader/spotlightShader.h +++ /dev/null @@ -1,67 +0,0 @@ -// Filename: spotlightShader.h -// Created by: mike (09Jan97) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// -#ifndef SPOTLIGHTSHADER_H -#define SPOTLIGHTSHADER_H -// -//////////////////////////////////////////////////////////////////// -// Includes -//////////////////////////////////////////////////////////////////// -#include "pandabase.h" - -#include "projtexShader.h" - -//////////////////////////////////////////////////////////////////// -// Defines -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// Class : SpotlightShader -// Description : -//////////////////////////////////////////////////////////////////// -class EXPCL_SHADER SpotlightShader : public ProjtexShader -{ -public: - SpotlightShader(int size = 256, float radius = 0.7); - - virtual void config(void); - // SpotlightShader uses ProjtexShader::apply() - -protected: - float _radius; - -public: - - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - ProjtexShader::init_type(); - register_type(_type_handle, "SpotlightShader", - ProjtexShader::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -private: - - static TypeHandle _type_handle; -}; - -#endif diff --git a/panda/src/testbed/downloader_test.cxx b/panda/src/testbed/downloader_test.cxx deleted file mode 100644 index df80172489..0000000000 --- a/panda/src/testbed/downloader_test.cxx +++ /dev/null @@ -1,84 +0,0 @@ -// Filename: downloader_test.cxx -// Created by: -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "eventHandler.h" -#include "chancfg.h" -#include "downloader.h" -#include "framework.h" -#include "decompressor.h" -#include "extractor.h" - -Downloader downloader; -Decompressor decompressor; -Extractor extractor; -Filename src_file; -Filename dest_file; - -void event_y(CPT_Event) { - downloader.request_download(src_file, dest_file, ""); -} - -void event_u(CPT_Event) { - downloader.request_download("/oldfoobar.mfz", "/fit/people/mike/download/oldfoobar.mfz", ""); -} - -void event_i(CPT_Event) { - downloader.request_download("/foobar.mfz", "/fit/people/mike/download/partfoobar.mfz", "", 0, 99, 151); -} - -void event_o(CPT_Event) { - downloader.request_download("/foobar.mfz", "/fit/people/mike/download/partfoobar.mfz", "", 100, 151, 151); -} - -void event_p(CPT_Event) { - decompressor.request_decompress("/fit/people/mike/download/dload.mf.pz", ""); -} - -void event_la(CPT_Event) { - extractor.request_extract("/fit/people/mike/download/dload.mf", ""); -} - -void loader_keys(EventHandler& eh) { - eh.add_hook("y", event_y); - eh.add_hook("u", event_u); - eh.add_hook("i", event_i); - eh.add_hook("o", event_o); - eh.add_hook("p", event_p); - eh.add_hook("[", event_la); -} - -int main(int argc, char *argv[]) { - - if (argc < 4) { - cerr << "Usage: download " << endl; - return 0; - } - - string server_name = argv[1]; - src_file = argv[2]; - dest_file = argv[3]; - argc -= 3; - argv += 3; - - define_keys = &loader_keys; - downloader.create_thread(); - downloader.connect_to_server(server_name); - decompressor.create_thread(); - extractor.create_thread(); - return framework_main(argc, argv); -} diff --git a/panda/src/testbed/herc.cxx b/panda/src/testbed/herc.cxx deleted file mode 100644 index 8b11692e9b..0000000000 --- a/panda/src/testbed/herc.cxx +++ /dev/null @@ -1,530 +0,0 @@ -// Filename: herc.cxx -// Created by: -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "eventHandler.h" -#include "projtexShader.h" -#include "shaderTransition.h" -#include "renderRelation.h" -#include "nodeRelation.h" -#include "chancfg.h" -#include -#include "texGenTransition.h" -#include "colorBlendTransition.h" -#include "colorMaskTransition.h" -#include "textureTransition.h" -#include "texMatrixTransition.h" -#include "spotlightShader.h" -#include "light.h" -#include "loader.h" -#include "look_at.h" -#include "get_rel_pos.h" -#include "transformTransition.h" -#include "geomNode.h" -#include "lightTransition.h" -#include "spotlight.h" -#include "projtexShadower.h" -#include "spheretexHighlighter.h" -#include "spheretexReflector.h" -#include "trackball.h" -#include "planarSlider.h" -#include "transform2sg.h" -#include "mouse.h" -#include "graphicsWindow.h" -#include "planarReflector.h" -#include "stencilTransition.h" -#include "plane.h" -#include "auto_bind.h" -#include "animControl.h" -#include "animControlCollection.h" -#include "renderBuffer.h" -#include "planeNode.h" -#include "outlineShader.h" -#include "pt_NamedNode.h" -#include "geomLine.h" - -#include "dconfig.h" - -Configure(shader_test); - -ConfigureFn(shader_test) {} - -PT(LensNode) tex_proj; -PT(Trackball) tex_proj_trackball; -PT(ProjtexShader) proj_shader; -PT(ProjtexShadower) proj_shadow; -PT(SpheretexShader) spheretex; -PT(SpheretexHighlighter) highlight; -PT(SpheretexReflector) sreflect; -PT(PlanarReflector) preflect; -PT(OutlineShader) outline_shader; -PT(GeomNode) proj_geom_node; -PT_NamedNode spot_shaft; - -PT_NamedNode herc; -PT_NamedNode ball; -PT_NamedNode hide_ball; - -ShaderTransition shader_trans; - -PT(Spotlight) tex_proj_spot; -PT(Trackball) tex_spot_trackball; -PT(SpotlightShader) spot_shader; - -PT(PlanarSlider) ball_slider; -bool follow_ball; - -RenderRelation* room_arc; -RenderRelation* spot_arc; -RenderRelation* ball_arc; -RenderRelation* hide_ball_arc; -RenderRelation* herc_arc; -RenderRelation* herc_rot_arc; -RenderRelation* camera_model_arc; - -extern PT_NamedNode render; -extern NodeAttributes initial_state; -extern PT_NamedNode lights; -extern PT_NamedNode root; -extern PT(GeomNode) geomnode; -extern PT_NamedNode cameras; -extern PT(MouseAndKeyboard) mak; - -extern void set_alt_trackball(Node *trackball); - -extern PT(GraphicsWindow) main_win; - -extern int framework_main(int argc, char *argv[]); -extern void (*extra_display_func)(); -extern void (*define_keys)(EventHandler&); -extern void (*extra_overrides_func)(ChanCfgOverrides&, std::string&); -extern void (*additional_idle)(); - -// nothing extra to do for either of these -void herc_display_func(void) { - Shader::Visualize* v = Shader::get_viz(); - if (v != (Shader::Visualize*)0L) - v->Flush(); -} - -void herc_overrides_func(ChanCfgOverrides &override, std::string&) { - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_DOUBLE|W_DEPTH|W_MULTISAMPLE|W_STENCIL))); - override.setField(ChanCfgOverrides::Title, "Lighting Demo"); -} - - -void herc_idle() { - static const double walk_speed = 4.0; // feet per second - - if (follow_ball) { - LPoint3f bp = get_rel_pos(ball, herc); - LVector2f bv2(bp[0], bp[1]); - float dist = length(bv2); - if (dist > 0.0001) { - LMatrix4f mat; - look_at(mat, LPoint3f(-bp[0], -bp[1], 0.0)); - herc_rot_arc->set_transition(new TransformTransition(mat)); - - float stride = walk_speed * ClockObject::get_global_clock()->get_dt(); - if (dist > stride) { - LVector2f step = bv2 / dist * stride; - - const TransformTransition *tt; - if (!get_transition_into(tt, herc_arc)) { - herc_arc->set_transition - (new TransformTransition - (LMatrix4f::translate_mat(step[0], step[1], 0.0))); - } else { - LMatrix4f mat = tt->get_matrix(); - mat(3, 0) += step[0]; - mat(3, 1) += step[1]; - herc_arc->set_transition(new TransformTransition(mat)); - } - } - } - } -} - -void event_p(CPT_Event) { - // The "p" key was pressed. Toggle projected texture. - static bool projtex_mode = false; - - projtex_mode = !projtex_mode; - if (!projtex_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, proj_shader); - clear_shader(herc_arc, proj_shader); - clear_shader(ball_arc, proj_shader); - - set_alt_trackball(NULL); - remove_child(tex_proj, proj_geom_node, RenderRelation::get_class_type()); - - } else { - set_shader(room_arc, proj_shader); - set_shader(herc_arc, proj_shader); - set_shader(ball_arc, proj_shader); - - set_alt_trackball(tex_proj_trackball); - // Display the texture projector frustum - RenderRelation *prr = new RenderRelation(tex_proj, proj_geom_node); - LightTransition *plt = new LightTransition(LightTransition::all_off()); - prr->set_transition(plt); - } -} - -void event_s(CPT_Event) { - // The "s" key was pressed. Toggle projected texture spotlight. - static bool projtexspot_mode = false; - LightTransition light_trans; - - projtexspot_mode = !projtexspot_mode; - if (!projtexspot_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, spot_shader); - clear_shader(herc_arc, spot_shader); - clear_shader(ball_arc, spot_shader); - - set_alt_trackball(NULL); - remove_child(tex_proj_spot, spot_shaft, RenderRelation::get_class_type()); - - } else { - set_shader(room_arc, spot_shader); - set_shader(herc_arc, spot_shader); - set_shader(ball_arc, spot_shader); - - set_alt_trackball(tex_spot_trackball); - new RenderRelation(tex_proj_spot, spot_shaft, 10); - } -} - -void event_d(CPT_Event) { - // The "d" key was pressed. Toggle projected texture shadows. - static bool projtex_shadow_mode = false; - - projtex_shadow_mode = !projtex_shadow_mode; - if (!projtex_shadow_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, proj_shadow); - set_alt_trackball(NULL); - - } else { - set_shader(room_arc, proj_shadow); - set_alt_trackball(tex_spot_trackball); - } -} - -void event_h(CPT_Event) { - // The "h" key was pressed. Toggle highlight. - static bool highlight_mode = false; - - highlight_mode = !highlight_mode; - if (!highlight_mode) { - // Set the normal mode on the render arc. - clear_shader(ball_arc, highlight); - - } else { - set_shader(ball_arc, highlight); - } -} - -void event_e(CPT_Event) { - // The "e" key was pressed. Toggle sphere texture. - static bool spheretex_mode = false; - - spheretex_mode = !spheretex_mode; - if (!spheretex_mode) { - // Set the normal mode on the render arc. - clear_shader(ball_arc, spheretex); - - } else { - // Set an override on the initial state. - set_shader(ball_arc, spheretex); - } -} - -void event_m(CPT_Event) { - // The "m" key was pressed. Toggle sphere reflection. - static bool sphere_reflect_mode = false; - - sphere_reflect_mode = !sphere_reflect_mode; - if (!sphere_reflect_mode) { - // Set the normal mode on the render arc. - clear_shader(ball_arc, sreflect); - - } else { - // Set an override on the initial state. - set_shader(ball_arc, sreflect); - } -} - -void event_r(CPT_Event) { - // The "r" key was pressed. Toggle planar reflection. - static bool plane_reflect_mode = false; - - plane_reflect_mode = !plane_reflect_mode; - if (!plane_reflect_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, preflect); - - } else { - // Set an override on the initial state. - set_shader(room_arc, preflect); - } -} - -void event_z(CPT_Event) { - // The "z" key was pressed. Allow the user to move the ball around. - set_alt_trackball(ball_slider); -} - -void event_Z(CPT_Event) { - // The "Z" key was pressed. Toggle follow-ball mode. - follow_ball = !follow_ball; - - if (follow_ball) { - // Hide the ball while we're following it. - remove_arc(hide_ball_arc); - } else { - // Reveal the ball when we're done following it. - hide_ball_arc = new RenderRelation(render, hide_ball); - } -} - -void event_o(CPT_Event) { - // The "o" key was pressed. Toggle outlining. - static bool outline_mode = false; - - outline_mode = !outline_mode; - if (!outline_mode) { - // Set the normal mode on the render arc. - clear_shader(herc_arc, outline_shader); - - } else { - set_shader(herc_arc, outline_shader); - } -} - -void herc_keys(EventHandler &eh) { - - eh.add_hook("p", event_p); // Projected Texture Shader - eh.add_hook("s", event_s); // Projected Texture Spotlight - eh.add_hook("d", event_d); // Projected Texture Shadower - eh.add_hook("e", event_e); // Sphere Texture Shader - eh.add_hook("h", event_h); // Sphere Texture Highlighter - eh.add_hook("m", event_m); // Sphere Texture Reflector - eh.add_hook("r", event_r); // Planar Reflector - eh.add_hook("z", event_z); // Move ball - eh.add_hook("Z", event_Z); // Follow ball - eh.add_hook("o", event_o); // Outlining - -//========================================================================== -// Models -//========================================================================== - // Load herc - PT_NamedNode herc_model = loader.load_sync("herc-6000.egg"); - PT_NamedNode herc_anim = loader.load_sync("HB_1_HE1.egg"); - assert(herc_model != (NamedNode *)NULL && - herc_anim != (NamedNode *)NULL); - PT_NamedNode herc_parent = new NamedNode("herc_parent"); - new RenderRelation(herc_parent, herc_model); - new RenderRelation(herc_parent, herc_anim); - AnimControlCollection anim_controls; - auto_bind(herc_parent, anim_controls, ~0); - // And start looping any animations we successfully bound. - anim_controls.loop_all(true); - PT_NamedNode herc_rot = new NamedNode("herc_rot"); - RenderRelation *herc_arc1 = new RenderRelation(herc_rot, herc_parent); - herc_arc1->set_transition - (new TransformTransition - (LMatrix4f::scale_mat(LVector3f(0.25, 0.25, 0.25)))); - herc = new NamedNode("herc"); - herc_rot_arc = new RenderRelation(herc, herc_rot); - herc_arc = new RenderRelation(render, herc); - - // Load ball - ball = loader.load_sync("marble_ball.egg"); - assert(ball != (NamedNode *)NULL); - PT_NamedNode scaled_ball = new NamedNode("scaled_ball"); - RenderRelation *ball_arc1 = new RenderRelation(scaled_ball, ball); - ball_arc1->set_transition - (new TransformTransition(LMatrix4f::scale_mat(0.2))); - hide_ball = new NamedNode("hide_ball"); - ball_arc = new RenderRelation(hide_ball, scaled_ball); - ball_arc->set_transition - (new TransformTransition(LMatrix4f::translate_mat(4., 2., 1.))); - hide_ball_arc = new RenderRelation(render, hide_ball); - - // Control the ball using a PlanarSlider tform. - ball_slider = new PlanarSlider("ball_slider"); - ball_slider->set_transform(LMatrix4f::translate_mat(0.0, 0.0, 1.0) * - LMatrix4f::scale_mat(7.0, -7.0, 1.0)); - ball_slider->set_mouse_pos(LPoint2f(4.0 / 7.0, 2.0 / -7.0)); - Transform2SG *slider2ball = new Transform2SG("slider2ball"); - slider2ball->set_arc(ball_arc); - new RenderRelation(ball_slider, slider2ball); - follow_ball = false; - - // Load the room file - PT_NamedNode room = loader.load_sync("lfloor.egg"); - assert(room != (NamedNode *)NULL); - room_arc = new RenderRelation(render, room); - - // Load up a camera model to visualize our eyepoint. - PT_NamedNode camera_model = loader.load_sync("camera.egg"); - assert(camera_model != (NamedNode *)NULL); - camera_model_arc = new RenderRelation(cameras, camera_model); - - // Remove any model that was loaded by default or on command line - if (root != (NamedNode *)NULL) - remove_child(render, root, RenderRelation::get_class_type()); - if (geomnode != (GeomNode *)NULL) - remove_child(render, geomnode, RenderRelation::get_class_type()); - - -//========================================================================== -// Projected Texture Shader -//========================================================================== - // Load a texture to project - Texture* tex = new Texture; - tex->read("smiley.rgba"); - tex->set_name("smiley.rgba"); - - // Put the texture projector into the scene graph - tex_proj = new LensNode("texture_projector"); - RenderRelation* proj_arc = new RenderRelation(render, tex_proj); - - // Create a trackball to spin this around. - tex_proj_trackball = new Trackball("tex_proj_trackball"); - tex_proj_trackball->set_invert(false); - tex_proj_trackball->set_rel_to(cameras); - Transform2SG *tball2cam = new Transform2SG("tball2cam"); - tball2cam->set_arc(proj_arc); - new RenderRelation(tex_proj_trackball, tball2cam); - - // Raise it and aim it at the origin - LMatrix4f proj_mat; - LPoint3f proj_pos = LPoint3f::rfu(2., 3., 8.); - LVector3f fwd_vec = proj_pos - LPoint3f::origin(); - look_at(proj_mat, -fwd_vec); - proj_mat.set_row(3, proj_pos); - tex_proj_trackball->set_mat(proj_mat); - proj_arc->set_transition(new TransformTransition(proj_mat)); - - // Create a shader for the texture projector - proj_shader = new ProjtexShader(tex); - proj_shader->add_frustum(tex_proj); - - // Create a wireframe representation of the texture projector frustum - PT(Geom) proj_geom = - tex_proj->get_lens()->make_geometry(); - proj_geom_node = new GeomNode("proj_geometry"); - proj_geom_node->add_geom(proj_geom); - - -//========================================================================== -// Projected Texture Spotlight Shader -//========================================================================== - tex_proj_spot = new Spotlight("tex_proj_spotlight"); - spot_arc = new RenderRelation(render, tex_proj_spot, 10); - - // Create a trackball to spin this around. - tex_spot_trackball = new Trackball("tex_spot_trackball"); - tex_spot_trackball->set_invert(false); - tex_spot_trackball->set_rel_to(cameras); - tball2cam = new Transform2SG("tball2cam"); - tball2cam->set_arc(spot_arc); - new RenderRelation(tex_spot_trackball, tball2cam); - - // Raise it and aim it at the origin - LMatrix4f spot_mat; - LPoint3f spot_pos = LPoint3f::rfu(-4., -3., 8.); - LVector3f spot_vec = spot_pos - LPoint3f::origin(); - look_at(spot_mat, -spot_vec); - spot_mat.set_row(3, spot_pos); - tex_spot_trackball->set_mat(spot_mat); - spot_arc->set_transition(new TransformTransition(spot_mat)); - - // Create a shader for the spotlight - spot_shader = new SpotlightShader; - spot_shader->add_frustum(tex_proj_spot); - - // Create a light shaft for the spotlight - spot_shaft = tex_proj_spot->make_geometry(0.05, 8.0, 36); - - -//========================================================================== -// Projected Texture Shadower -//========================================================================== - proj_shadow = new ProjtexShadower; - proj_shadow->add_frustum(tex_proj_spot); - proj_shadow->add_caster(herc); - proj_shadow->add_caster(ball); - proj_shadow->add_caster(camera_model); - - -//========================================================================== -// Sphere Texture Shader -//========================================================================== - spheretex = new SpheretexShader(tex); - - -//========================================================================== -// Sphere Texture Highlighter -//========================================================================== - highlight = new SpheretexHighlighter; - highlight->add_frustum(tex_proj_spot); - - -//========================================================================== -// Sphere Texture Reflector -//========================================================================== - sreflect = new SpheretexReflector; - sreflect->add_frustum(tex_proj_spot); - sreflect->add_caster(room); - sreflect->add_caster(herc); - sreflect->add_caster(camera_model); - - -//========================================================================== -// Planar Reflector -//========================================================================== - // Create a plane that corresponds to the floor of the room - Planef p(LVector3f::up(), LPoint3f::origin()); - PlaneNode* plane_node = new PlaneNode; - plane_node->set_plane(p); - new RenderRelation(room, plane_node); - preflect = new PlanarReflector(plane_node); - preflect->add_caster(ball); - preflect->add_caster(herc); - preflect->add_caster(camera_model); - - -//========================================================================== -// Outline Shader -//========================================================================== - outline_shader = new OutlineShader; - - additional_idle = &herc_idle; -} - -int main(int argc, char *argv[]) { - extra_display_func = &herc_display_func; - define_keys = &herc_keys; - extra_overrides_func = &herc_overrides_func; - return framework_main(argc, argv); -} diff --git a/panda/src/testbed/indirect.cxx b/panda/src/testbed/indirect.cxx deleted file mode 100644 index 04f325fb6d..0000000000 --- a/panda/src/testbed/indirect.cxx +++ /dev/null @@ -1,173 +0,0 @@ -// Filename: indirect.cxx -// Created by: cary (25Mar99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "eventHandler.h" -#include "texture.h" -#include "graphicsWindow.h" -#include "graphicsStateGuardian.h" -#include "pixelBuffer.h" -#include "dconfig.h" -#include "chancfg.h" -#include - -Configure(indirect); - -extern GraphicsWindow* win; -extern std::string chan_config; - -extern int framework_main(int argc, char *argv[]); -extern void (*extra_display_func)(); -extern void (*define_keys)(EventHandler&); -extern void (*first_init)(); - -Texture* t = (Texture*)0L; -PixelBuffer* pb = (PixelBuffer *)0L; -DisplayRegion* dr1 = (DisplayRegion*)0L; -DisplayRegion* dr2 = (DisplayRegion*)0L; - -bool use_canned_texture = indirect.GetBool("canned-texture", false); -bool use_texture = indirect.GetBool("use-texture", true); -bool full_region = indirect.GetBool("full-region", true); -bool side_by_side = indirect.GetBool("side-by-side", true); -bool right_to_left = indirect.GetBool("right-to-left", true); - -int logs[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 0 }; - -int binary_log_cap(int x) { - int i = 0; - for (; (x > logs[i])&&(logs[i] != 0); ++i); - if (logs[i] == 0) - return 4096; - return logs[i]; -} - -void indirect_display_func( void ) { - GraphicsStateGuardian* g = win->get_gsg(); - const RenderBuffer& rf = g->get_render_buffer(RenderBuffer::T_front); - const RenderBuffer& rb = g->get_render_buffer(RenderBuffer::T_back); - - if (use_texture) { - if (t == (Texture*)0L) { - t = new Texture; - if (use_canned_texture) - t->read( "smiley.rgba" ); - else if (full_region) { - int a, b, w, h; - dr1->get_region_pixels(a, b, w, h); - t->_pbuffer->set_xsize(binary_log_cap(w)); - t->_pbuffer->set_ysize(binary_log_cap(h)); - } else { - t->_pbuffer->set_xsize( 512 ); - t->_pbuffer->set_ysize( 512 ); - } - } - if (side_by_side) { - if (right_to_left) - g->prepare_display_region(dr2); - else - g->prepare_display_region(dr1); - } - if (!use_canned_texture) { - if (full_region) { - if (side_by_side) { - if (right_to_left) - t->copy_from( rb, dr2 ); - else - t->copy_from( rb, dr1 ); - } else - t->copy_from( rb, dr1 ); - } else - t->copy_from( rb ); - } - if (side_by_side) { - if (right_to_left) - g->prepare_display_region(dr1); - else - g->prepare_display_region(dr2); - } - if (full_region) { - if (side_by_side) { - if (right_to_left) - t->draw_to( rf, dr1 ); - else - t->draw_to( rf, dr2 ); - } else - t->draw_to( rf, dr1 ); - } else - t->draw_to( rf ); - } else { - if (pb == (PixelBuffer*)0L) { - pb = new PixelBuffer; - if (use_canned_texture) - pb->read( "smiley.rgba" ); - else if (full_region) { - int a, b, w, h; - dr1->get_region_pixels(a, b, w, h); - w = binary_log_cap(w); - h = binary_log_cap(h); - pb->set_xsize(w); - pb->set_ysize(h); - pb->_image = PTA_uchar(w * h * 3); - } else { - pb->set_xsize(512); - pb->set_ysize(512); - pb->_image = PTA_uchar(512 * 512 * 3); - } - } - if (side_by_side) { - if (right_to_left) - g->prepare_display_region(dr2); - else - g->prepare_display_region(dr1); - } - if (!use_canned_texture) - pb->copy_from( rf ); - if (side_by_side) { - if (right_to_left) - g->prepare_display_region(dr1); - else - g->prepare_display_region(dr2); - } - pb->draw_to( rf ); - } -} - -void indirect_init(void) { - if (side_by_side) - chan_config = "two-frame"; -} - -void indirect_keys(EventHandler&) { - DRList::iterator i = win->getDRBegin(); - dr1 = *i; - if (side_by_side) { - ++i; - dr2 = *i; - if (right_to_left) - dr1->set_active(false); - else - dr2->set_active(false); - } -} - -int main(int argc, char *argv[]) { - define_keys = &indirect_keys; - extra_display_func = &indirect_display_func; - first_init = &indirect_init; - return framework_main(argc, argv); -} diff --git a/panda/src/testbed/loader_test.cxx b/panda/src/testbed/loader_test.cxx deleted file mode 100644 index ecc232b932..0000000000 --- a/panda/src/testbed/loader_test.cxx +++ /dev/null @@ -1,68 +0,0 @@ -// Filename: loader_test.cxx -// Created by: -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "eventHandler.h" -#include "chancfg.h" -#include "get_rel_pos.h" -#include "loader.h" -#include "pt_NamedNode.h" -#include "framework.h" - -uint model_id; -const int MAX_LOOPS = 100; - -void event_p(CPT_Event) { - //model_id = loader.request_load("jafar-statue.egg"); - //model_id = loader.request_load("camera.egg"); - //model_id = loader.request_load("box.egg"); - //model_id = loader.request_load("yup-axis.egg"); - //model_id = loader.request_load("hand.egg"); - - //model_id = loader.request_load("frowney.egg", ""); - //model_id = loader.request_load("trolley.bam", ""); - //model_id = loader.request_load("smiley.egg", ""); - //model_id = loader.request_load("jack.bam", ""); - model_id = loader.request_load("herc-6000.egg", ""); -} - -void event_c(CPT_Event) { - if (loader.check_load(model_id)) - cerr << "load is complete" << endl; - else - cerr << "loading not finished yet" << endl; -} - -void event_s(CPT_Event) { - PT_Node model = loader.fetch_load(model_id); - if (model != (NamedNode*)0L) - new RenderRelation(render, model); - else - cerr << "null model!" << endl; -} - -void loader_keys(EventHandler& eh) { - eh.add_hook("p", event_p); - eh.add_hook("c", event_c); - eh.add_hook("s", event_s); -} - -int main(int argc, char *argv[]) { - define_keys = &loader_keys; -// loader.fork_asynchronous_thread(); - return framework_main(argc, argv); -} diff --git a/panda/src/testbed/min_herc.cxx b/panda/src/testbed/min_herc.cxx deleted file mode 100644 index cf4d8e7a2d..0000000000 --- a/panda/src/testbed/min_herc.cxx +++ /dev/null @@ -1,444 +0,0 @@ -// Filename: min_herc.cxx -// Created by: jason (28Jun00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -//Shaders -#include "projtexShader.h" -#include "spotlightShader.h" -#include "projtexShadower.h" -#include "planarReflector.h" - -//Channel stuff -#include "chancfg.h" - -//Textures -#include "texture.h" -#include "texturePool.h" - -//Transitions -#include "textureTransition.h" -#include "shaderTransition.h" -#include "lightTransition.h" -#include "transformTransition.h" -#include "colorBlendTransition.h" - -//Light stuff -#include "light.h" -#include "spotlight.h" - -//Nodes -#include "pt_NamedNode.h" -#include "geomNode.h" - -//Relations (arcs) -#include "renderRelation.h" -#include "nodeRelation.h" -#include "dataRelation.h" - -//Misc -#include "dconfig.h" -#include "framework.h" -#include "loader.h" -#include "eventHandler.h" -#include "geomLine.h" - -//Math/Matrix/Vector/Transformation stuff -#include "transform2sg.h" -#include "look_at.h" -#include "perspectiveLens.h" -#include "get_rel_pos.h" - -//Control/IO -#include "planarSlider.h" -#include "mouse.h" - -//Animation -#include "animControl.h" -#include "animControlCollection.h" -#include "auto_bind.h" - -Configure(min_herc); -ConfigureFn(min_herc) { -} - -PT(LensNode) tex_proj; -PT(Trackball) tex_proj_trackball; -PT(ProjtexShader) proj_shader; -PT(ProjtexShadower) proj_shadow; -PT(PlanarReflector) preflect; -PT(GeomNode) proj_geom_node; -PT_NamedNode spot_shaft; - -PT_NamedNode herc; -PT_NamedNode ball; -PT_NamedNode hide_ball; - -ShaderTransition shader_trans; - -PT(Spotlight) tex_proj_spot; -PT(Trackball) tex_spot_trackball; -PT(SpotlightShader) spot_shader; - -PT(PlanarSlider) ball_slider; -bool follow_ball; - -RenderRelation* room_arc; -RenderRelation* spot_arc; -RenderRelation* ball_arc; -RenderRelation* hide_ball_arc; -RenderRelation* herc_arc; -RenderRelation* herc_rot_arc; -RenderRelation* camera_model_arc; - -extern PT_NamedNode render; -extern NodeAttributes initial_state; -extern PT_NamedNode lights; -extern PT_NamedNode egg_root; -extern PT(GeomNode) geomnode; -extern PT_NamedNode cameras; -extern PT(MouseAndKeyboard) mak; - -extern void set_alt_trackball(Node *trackball); - -extern PT(GraphicsWindow) main_win; - -extern int framework_main(int argc, char *argv[]); -extern void (*extra_display_func)(); -extern void (*define_keys)(EventHandler&); -extern void (*extra_overrides_func)(ChanCfgOverrides&, std::string&); -extern void (*additional_idle)(); - -void herc_overrides_func(ChanCfgOverrides &override, std::string&) { - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_DOUBLE|W_DEPTH|W_MULTISAMPLE|W_STENCIL))); - override.setField(ChanCfgOverrides::Title, "Lighting Demo"); -} - - -void herc_idle() { - static const double walk_speed = 4.0; // feet per second - - if (follow_ball) { - LPoint3f bp = get_rel_pos(ball, herc); - LVector2f bv2(bp[0], bp[1]); - float dist = length(bv2); - if (dist > 0.0001) { - LMatrix4f mat; - look_at(mat, LPoint3f(-bp[0], -bp[1], 0.0)); - herc_rot_arc->set_transition(new TransformTransition(mat)); - - float stride = walk_speed * ClockObject::get_global_clock()->get_dt(); - if (dist > stride) { - LVector2f step = bv2 / dist * stride; - - const TransformTransition *tt; - if (!get_transition_into(tt, herc_arc)) { - herc_arc->set_transition - (new TransformTransition - (LMatrix4f::translate_mat(step[0], step[1], 0.0))); - } else { - LMatrix4f mat = tt->get_matrix(); - mat(3, 0) += step[0]; - mat(3, 1) += step[1]; - herc_arc->set_transition(new TransformTransition(mat)); - } - } - } - } -} - -void event_p(CPT_Event) { - // The "p" key was pressed. Toggle projected texture. - static bool projtex_mode = false; - - projtex_mode = !projtex_mode; - if (!projtex_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, proj_shader); - clear_shader(herc_arc, proj_shader); - clear_shader(ball_arc, proj_shader); - - set_alt_trackball(NULL); - remove_child(tex_proj, proj_geom_node, RenderRelation::get_class_type()); - - } else { - set_shader(room_arc, proj_shader); - set_shader(herc_arc, proj_shader); - set_shader(ball_arc, proj_shader); - - set_alt_trackball(tex_proj_trackball); - // Display the texture projector frustum - RenderRelation *prr = new RenderRelation(tex_proj, proj_geom_node); - LightTransition *plt = new LightTransition(LightTransition::all_off()); - prr->set_transition(plt); - } -} - -void event_s(CPT_Event) { - // The "s" key was pressed. Toggle projected texture spotlight. - static bool projtexspot_mode = false; - LightTransition light_trans; - - projtexspot_mode = !projtexspot_mode; - if (!projtexspot_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, spot_shader); - clear_shader(herc_arc, spot_shader); - clear_shader(ball_arc, spot_shader); - - set_alt_trackball(NULL); - remove_child(tex_proj_spot, spot_shaft, RenderRelation::get_class_type()); - - } else { - set_shader(room_arc, spot_shader); - set_shader(herc_arc, spot_shader); - set_shader(ball_arc, spot_shader); - - set_alt_trackball(tex_spot_trackball); - new RenderRelation(tex_proj_spot, spot_shaft, 10); - } -} - -void event_d(CPT_Event) { - // The "d" key was pressed. Toggle projected texture shadows. - static bool projtex_shadow_mode = false; - - projtex_shadow_mode = !projtex_shadow_mode; - if (!projtex_shadow_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, proj_shadow); - set_alt_trackball(NULL); - - } else { - set_shader(room_arc, proj_shadow); - set_alt_trackball(tex_spot_trackball); - } -} - -void event_r(CPT_Event) { - // The "r" key was pressed. Toggle planar reflection. - static bool plane_reflect_mode = false; - - plane_reflect_mode = !plane_reflect_mode; - if (!plane_reflect_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, preflect); - - } else { - // Set an override on the initial state. - set_shader(room_arc, preflect); - } -} - -void event_z(CPT_Event) { - // The "z" key was pressed. Allow the user to move the ball around. - set_alt_trackball(ball_slider); -} - -void event_Z(CPT_Event) { - // The "Z" key was pressed. Toggle follow-ball mode. - follow_ball = !follow_ball; - - if (follow_ball) { - // Hide the ball while we're following it. - remove_arc(hide_ball_arc); - } else { - // Reveal the ball when we're done following it. - hide_ball_arc = new RenderRelation(render, hide_ball); - } -} - -void herc_keys(EventHandler &eh) { - Loader loader; - - eh.add_hook("p", event_p); // Projected Texture Shader - eh.add_hook("s", event_s); // Projected Texture Spotlight - eh.add_hook("d", event_d); // Projected Texture Shadower - eh.add_hook("r", event_r); // Planar Reflector - eh.add_hook("z", event_z); // Move ball - eh.add_hook("Z", event_Z); // Follow ball - -//========================================================================== -// Models -//========================================================================== - // Load herc - PT_NamedNode herc_model = DCAST(NamedNode, loader.load_sync("herc-6000.egg")); - PT_NamedNode herc_anim = DCAST(NamedNode, loader.load_sync("HB_1_HE1.egg")); - assert(herc_model != (NamedNode *)NULL && - herc_anim != (NamedNode *)NULL); - PT_NamedNode herc_parent = new NamedNode("herc_parent"); - new RenderRelation(herc_parent, herc_model); - new RenderRelation(herc_parent, herc_anim); - - AnimControlCollection anim_controls; - auto_bind(herc_parent, anim_controls, ~0); - - // And start looping any animations we successfully bound. - anim_controls.loop_all(true); - - PT_NamedNode herc_rot = new NamedNode("herc_rot"); - RenderRelation *herc_arc1 = new RenderRelation(herc_rot, herc_parent); - herc_arc1->set_transition - (new TransformTransition - (LMatrix4f::scale_mat(LVector3f(0.25, 0.25, 0.25)))); - herc = new NamedNode("herc"); - herc_rot_arc = new RenderRelation(herc, herc_rot); - herc_arc = new RenderRelation(render, herc); - - // Load ball - ball = DCAST(NamedNode, loader.load_sync("marble_ball.egg")); - assert(ball != (NamedNode *)NULL); - PT_NamedNode scaled_ball = new NamedNode("scaled_ball"); - RenderRelation *ball_arc1 = new RenderRelation(scaled_ball, ball); - ball_arc1->set_transition - (new TransformTransition(LMatrix4f::scale_mat(0.2))); - hide_ball = new NamedNode("hide_ball"); - ball_arc = new RenderRelation(hide_ball, scaled_ball); - ball_arc->set_transition - (new TransformTransition(LMatrix4f::translate_mat(4., 2., 1.))); - hide_ball_arc = new RenderRelation(render, hide_ball); - - // Control the ball using a PlanarSlider tform. - ball_slider = new PlanarSlider("ball_slider"); - ball_slider->set_transform(LMatrix4f::translate_mat(0.0, 0.0, 1.0) * - LMatrix4f::scale_mat(7.0, -7.0, 1.0)); - ball_slider->set_mouse_pos(LPoint2f(4.0 / 7.0, 2.0 / -7.0)); - Transform2SG *slider2ball = new Transform2SG("slider2ball"); - slider2ball->set_arc(ball_arc); - new RenderRelation(ball_slider, slider2ball); - follow_ball = false; - - // Load the room file - PT_NamedNode room = DCAST(NamedNode, loader.load_sync("lfloor.egg")); - assert(room != (NamedNode *)NULL); - room_arc = new RenderRelation(render, room); - - // Load up a camera model to visualize our eyepoint. - PT_NamedNode camera_model = DCAST(NamedNode, loader.load_sync("camera.egg")); - assert(camera_model != (NamedNode *)NULL); - camera_model_arc = new RenderRelation(cameras, camera_model); - - // Remove any model that was loaded by default or on command line - if (root != (NamedNode *)NULL) - remove_child(render, root, RenderRelation::get_class_type()); - if (geomnode != (GeomNode *)NULL) - remove_child(render, geomnode, RenderRelation::get_class_type()); - - -//========================================================================== -// Projected Texture Shader -//========================================================================== - // Load a texture to project - Texture* tex = TexturePool::load_texture("smiley.rgba"); - tex->set_minfilter(Texture::FT_linear); - tex->set_magfilter(Texture::FT_linear); - tex->set_wrapu(Texture::WM_clamp); - tex->set_wrapv(Texture::WM_clamp); - - // Put the texture projector into the scene graph - tex_proj = new LensNode("texture_projector"); - RenderRelation* proj_arc = new RenderRelation(render, tex_proj); - - // Create a trackball to spin this around. - tex_proj_trackball = new Trackball("tex_proj_trackball"); - tex_proj_trackball->set_invert(false); - tex_proj_trackball->set_rel_to(cameras); - Transform2SG *tball2cam = new Transform2SG("tball2cam"); - tball2cam->set_arc(proj_arc); - new RenderRelation(tex_proj_trackball, tball2cam); - - // Raise it and aim it at the origin - LMatrix4f proj_mat; - LPoint3f proj_pos = LPoint3f::rfu(2., 3., 8.); - LVector3f fwd_vec = proj_pos - LPoint3f::origin(); - look_at(proj_mat, -fwd_vec); - proj_mat.set_row(3, proj_pos); - tex_proj_trackball->set_mat(proj_mat); - proj_arc->set_transition(new TransformTransition(proj_mat)); - - // Create a shader for the texture projector - proj_shader = new ProjtexShader(tex); - proj_shader->add_frustum(tex_proj); - - // Create a wireframe representation of the texture projector frustum - PT(Geom) proj_geom = - tex_proj->get_lens()->make_geometry(); - proj_geom_node = new GeomNode("proj_geometry"); - proj_geom_node->add_geom(proj_geom); - - -//========================================================================== -// Projected Texture Spotlight Shader -//========================================================================== - tex_proj_spot = new Spotlight("tex_proj_spotlight"); - spot_arc = new RenderRelation(render, tex_proj_spot, 10); - - // Create a trackball to spin this around. - tex_spot_trackball = new Trackball("tex_spot_trackball"); - tex_spot_trackball->set_invert(false); - tex_spot_trackball->set_rel_to(cameras); - tball2cam = new Transform2SG("tball2cam"); - tball2cam->set_arc(spot_arc); - new RenderRelation(tex_spot_trackball, tball2cam); - - // Raise it and aim it at the origin - LMatrix4f spot_mat; - LPoint3f spot_pos = LPoint3f::rfu(-4., -3., 8.); - LVector3f spot_vec = spot_pos - LPoint3f::origin(); - look_at(spot_mat, -spot_vec); - spot_mat.set_row(3, spot_pos); - tex_spot_trackball->set_mat(spot_mat); - spot_arc->set_transition(new TransformTransition(spot_mat)); - - // Create a shader for the spotlight - spot_shader = new SpotlightShader; - spot_shader->add_frustum(tex_proj_spot); - - // Create a light shaft for the spotlight - spot_shaft = tex_proj_spot->make_geometry(0.05, 8.0, 36); - - -//========================================================================== -// Projected Texture Shadower -//========================================================================== - proj_shadow = new ProjtexShadower; - proj_shadow->add_frustum(tex_proj_spot); - proj_shadow->add_caster(herc); - proj_shadow->add_caster(ball); - proj_shadow->add_caster(camera_model); - -//========================================================================== -// Planar Reflector -//========================================================================== - // Create a plane that corresponds to the floor of the room - Planef p(LVector3f::up(), LPoint3f::origin()); - PlaneNode* plane_node = new PlaneNode; - plane_node->set_plane(p); - new RenderRelation(room, plane_node); - preflect = new PlanarReflector(plane_node); - preflect->add_caster(ball); - preflect->add_caster(herc); - preflect->add_caster(camera_model); - - additional_idle = &herc_idle; -} - -int main(int argc, char *argv[]) { - define_keys = &herc_keys; - extra_overrides_func = &herc_overrides_func; - return framework_main(argc, argv); -} diff --git a/panda/src/testbed/min_shader.cxx b/panda/src/testbed/min_shader.cxx deleted file mode 100644 index 9a48b31ccb..0000000000 --- a/panda/src/testbed/min_shader.cxx +++ /dev/null @@ -1,823 +0,0 @@ -// Filename: min_shader.cxx -// Created by: jason (28Jun00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -//Shaders -#include "projtexShader.h" -#include "spotlightShader.h" -#include "projtexShadower.h" -#include "planarReflector.h" -#include "spheretexReflector.h" -#include "spheretexHighlighter.h" -#include "spheretexReflector.h" -#include "outlineShader.h" - -//Channel stuff -#include "chancfg.h" - -//Textures -#include "texture.h" -#include "texturePool.h" - -//Transitions -#include "textureTransition.h" -#include "shaderTransition.h" -#include "lightTransition.h" -#include "transformTransition.h" -#include "colorBlendTransition.h" - -//Light stuff -#include "light.h" -#include "spotlight.h" - -//Nodes -#include "pt_NamedNode.h" -#include "geomNode.h" - -//Relations (arcs) -#include "renderRelation.h" -#include "nodeRelation.h" -#include "dataRelation.h" - -//Misc -#include "dconfig.h" -#include "framework.h" -#include "loader.h" -#include "eventHandler.h" - -//Math/Matrix/Vector/Transformation stuff -#include "transform2sg.h" -#include "look_at.h" -#include "perspectiveLens.h" -#include "geomLine.h" - -Configure(min_shader); -ConfigureFn(min_shader) { -} - -//--------Projective texture stuff-------- -PT(LensNode) tex_proj; -PT(Trackball) tex_proj_trackball; -PT(ProjtexShader) proj_shader; -//--------Spotlight stuff----------------- -PT(Spotlight) tex_proj_spot; -PT(Trackball) tex_spot_trackball; -PT(SpotlightShader) spot_shader; -//--------Projective Shadow stuff-------- -PT(ProjtexShadower) proj_shadow; -//--------Planar reflecter stuff--------- -PT(PlanarReflector) preflect; -//--------Sphere texture stuff--------- -PT(SpheretexShader) spheretex; -//--------Sphere texture highlight stuff--------- -PT(SpheretexHighlighter) highlight; -//--------Sphere texture reflector stuff--------- -PT(SpheretexReflector) sreflect; -//--------Outline shader stuff--------- -PT(OutlineShader) outline_shader; - -ShaderTransition shader_trans; - -RenderRelation* room_arc; -RenderRelation* spot_arc; -RenderRelation* jack_arc; -RenderRelation* camera_model_arc; -RenderRelation* smiley_arc; - -PT(LightTransition) light_transition; - -//Framework extern variables and functions -extern PT_NamedNode render; -extern NodeAttributes initial_state; -extern RenderRelation* first_arc; -extern PT_NamedNode lights; -extern PT_NamedNode root; -extern PT(GeomNode) geomnode; -extern PT_NamedNode cameras; -extern PT(MouseAndKeyboard) mak; - -extern void set_alt_trackball(Node *trackball); - -extern int framework_main(int argc, char *argv[]); -extern void (*extra_display_func)(); -extern void (*define_keys)(EventHandler&); - -extern PT(GraphicsWindow) main_win; - -//GLOBALS -LPoint3f center_pos = LPoint3f::origin(); -Transform2SG *tball2cam; -Texture* tex; - -//VIZ STUFF -class BaseViz : public Shader::Visualize { -public: - BaseViz(void); - virtual ~BaseViz(void); - virtual void DisplayTexture(PT(Texture)&, Shader*); - virtual void DisplayPixelBuffer(PT(PixelBuffer)&, Shader*); -protected: - typedef std::plist texlist; - typedef texlist::iterator texiter; - typedef std::plist pblist; - typedef pblist::iterator pbiter; - - texlist _texs; - pblist _pbs; -}; - -BaseViz::BaseViz(void) {} - -BaseViz::~BaseViz(void) {} - -void BaseViz::DisplayTexture(PT(Texture)& tex, Shader*) { - if (tex->has_ram_image()) - _texs.push_back(tex); - else { - GraphicsStateGuardian* g = main_win->get_gsg(); - PT(PixelBuffer) pb(new PixelBuffer); - g->texture_to_pixel_buffer(tex->prepare(g), pb); - _pbs.push_back(pb); - } -} - -void BaseViz::DisplayPixelBuffer(PT(PixelBuffer)& pb, Shader*) { - _pbs.push_back(pb); -} - -class Oldviz : public BaseViz { -public: - Oldviz(PT(GraphicsWindow)&); - virtual ~Oldviz(void); - virtual void Flush(void); -protected: - PT(GraphicsWindow) _w; -}; - -Oldviz::Oldviz(PT(GraphicsWindow)& win) : _w(win) {} - -Oldviz::~Oldviz(void) {} - -void Oldviz::Flush(void) { - GraphicsStateGuardian* g = _w->get_gsg(); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - PT(DisplayRegion) d(_w->make_scratch_display_region(256, 256)); - - for (texiter i=_texs.begin(); i!=_texs.end(); ++i) - (*i)->draw(g, d, r); - for (pbiter j=_pbs.begin(); j!=_pbs.end(); ++j) - (*j)->draw(g, d, r); - _texs.erase(_texs.begin(), _texs.end()); - _pbs.erase(_pbs.begin(), _pbs.end()); -} - -class Viztex : public BaseViz { -public: - Viztex(PT(GraphicsPipe)&); - virtual ~Viztex(void); - virtual void Flush(void); -protected: - typedef std::plist< PT(GraphicsWindow) > winlist; - typedef winlist::iterator winiter; - - winlist _wins; - PT(GraphicsPipe) _pipe; -}; - -Viztex::Viztex(PT(GraphicsPipe)& p) : _pipe(p) {} - -Viztex::~Viztex(void) {} - -void Viztex::Flush(void) { - winiter _witer = _wins.begin(); - - for (texiter i=_texs.begin(); i!=_texs.end(); ++i) { - GraphicsWindow* w; - - if (_witer == _wins.end()) { - ChanCfgOverrides override; - - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_SINGLE))); - override.setField(ChanCfgOverrides::Title, "Multipass partial"); - override.setField(ChanCfgOverrides::SizeX, 256); - override.setField(ChanCfgOverrides::SizeY, 256); - override.setField(ChanCfgOverrides::Cameras, false); - w = ChanConfig(_pipe, "single", (Node *)NULL, render, override); - _wins.push_back(w); - } - else - { - w = *_witer; - ++_witer; - } - GraphicsStateGuardian* g = w->get_gsg(); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - PT(DisplayRegion) d(w->make_scratch_display_region(w->get_width(), - w->get_height())); - // g->prepare_display_region(d); - (*i)->draw(g, d, r); - } - for (pbiter j=_pbs.begin(); j!=_pbs.end(); ++j) { - GraphicsWindow* w; - - if (_witer == _wins.end()) { - ChanCfgOverrides override; - - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_SINGLE))); - override.setField(ChanCfgOverrides::Title, "Multipass partial"); - override.setField(ChanCfgOverrides::SizeX, 256); - override.setField(ChanCfgOverrides::SizeY, 256); - override.setField(ChanCfgOverrides::Cameras, false); - w = ChanConfig(_pipe, "single", cameras, render, override); - _wins.push_back(w); - } else { - w = *_witer; - ++_witer; - } - GraphicsStateGuardian* g = w->get_gsg(); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - PT(DisplayRegion) d(w->make_scratch_display_region(w->get_width(), - w->get_height())); - // g->prepare_display_region(d); - (*j)->draw(g, d, r); - } - _texs.erase(_texs.begin(), _texs.end()); - _pbs.erase(_pbs.begin(), _pbs.end()); -} - -class Tiledviz : public Viztex { -public: - Tiledviz(PT(GraphicsPipe)&); - virtual ~Tiledviz(void); - virtual void Flush(void); -}; - -Tiledviz::Tiledviz(PT(GraphicsPipe)& p) : Viztex(p) {} - -Tiledviz::~Tiledviz(void) {} - -void Tiledviz::Flush(void) { - int count = 0; - int layer_count = 0; - winiter _witer = _wins.begin(); - - for (texiter texi=_texs.begin(); texi!=_texs.end(); ++texi) { - GraphicsWindow* w; - DisplayRegion* d; - - if (_witer == _wins.end()) { - ChanCfgOverrides override; - - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_SINGLE))); - override.setField(ChanCfgOverrides::Title, "Multipass partial"); - override.setField(ChanCfgOverrides::SizeX, main_win->get_width()); - override.setField(ChanCfgOverrides::SizeY, main_win->get_height()); - override.setField(ChanCfgOverrides::Cameras, false); - w = ChanConfig(_pipe, "multipass-tile", cameras, render, override); - _wins.push_back(w); - _witer = --(_wins.end()); - } else - w = *_witer; - - int dridx; - GraphicsStateGuardian* g = w->get_gsg(); - GraphicsChannel *chan = w->get_channel(0); - GraphicsLayer *layer = chan->get_layer(layer_count); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - - d = layer->get_dr(count); - (*texi)->draw(g, d, r); - - ++count; - if (count == layer->get_num_drs()) { - count = 0; - ++layer_count; - } - - if (layer_count == chan->get_num_layers()) - { - layer_count = 0; - ++_witer; - } - } - - for (pbiter pbi=_pbs.begin(); pbi!=_pbs.end(); ++pbi) { - GraphicsWindow* w; - DisplayRegion* d; - - if (_witer == _wins.end()) { - ChanCfgOverrides override; - - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_SINGLE))); - override.setField(ChanCfgOverrides::Title, "Multipass partial"); - override.setField(ChanCfgOverrides::SizeX, main_win->get_width()); - override.setField(ChanCfgOverrides::SizeY, main_win->get_height()); - override.setField(ChanCfgOverrides::Cameras, false); - w = ChanConfig(_pipe, "multipass-tile", cameras, render, override); - _wins.push_back(w); - _witer = --(_wins.end()); - } else - w = *_witer; - - int dridx; - GraphicsStateGuardian* g = w->get_gsg(); - GraphicsChannel *chan = w->get_channel(0); - GraphicsLayer *layer = chan->get_layer(layer_count); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - - d = layer->get_dr(count); - (*pbi)->draw(g, d, r); - - ++count; - if (count == layer->get_num_drs()) { - count = 0; - ++layer_count; - } - - if (layer_count == chan->get_num_layers()) - { - layer_count = 0; - ++_witer; - } - - } - _texs.erase(_texs.begin(), _texs.end()); - _pbs.erase(_pbs.begin(), _pbs.end()); -} - -void shader_display_func(void) { - Shader::Visualize* v = Shader::get_viz(); - if (v != (Shader::Visualize*)0L) - v->Flush(); -} - -//END VIZ STUFF - -//////////////////////////////////////////////////////////////////// -// Function: event_p -// Access: Public -// Description: Toggle the projective texture being on and off -//////////////////////////////////////////////////////////////////// -void event_p(CPT_Event) { - static bool projtex_mode = false; - - projtex_mode = !projtex_mode; - if (!projtex_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, proj_shader); - //clear_shader(first_arc, proj_shader); - //clear_shader(jack_arc, proj_shader); - - set_alt_trackball(NULL); - - } else { - // Set an override on the initial state. - set_shader(room_arc, proj_shader); - //set_shader(first_arc, proj_shader); - //set_shader(jack_arc, proj_shader); - - set_alt_trackball(tex_proj_trackball); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: event_s -// Access: Public -// Description: Toggle the spotlight being on and off -//////////////////////////////////////////////////////////////////// -void event_s(CPT_Event) { - static bool projtexspot_mode = false; - - projtexspot_mode = !projtexspot_mode; - if (!projtexspot_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, spot_shader); - - set_alt_trackball(NULL); - } else { - // Set an override on the initial state. - set_shader(room_arc, spot_shader); - - set_alt_trackball(tex_spot_trackball); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: event_d -// Access: Public -// Description: Toggle projected shadows -//////////////////////////////////////////////////////////////////// -void event_d(CPT_Event) -{ - static bool projtex_shadow_mode = false; - - projtex_shadow_mode = !projtex_shadow_mode; - if (!projtex_shadow_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, proj_shadow); - set_alt_trackball(NULL); - - } - else - { - set_shader(room_arc, proj_shadow); - set_alt_trackball(tex_spot_trackball); - } -} - - -//////////////////////////////////////////////////////////////////// -// Function: event_r -// Access: Public -// Description: Toggle planar reflection -//////////////////////////////////////////////////////////////////// -void event_r(CPT_Event) -{ - static bool plane_reflect_mode = false; - - plane_reflect_mode = !plane_reflect_mode; - if (!plane_reflect_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, preflect); - } - else - { - // Set an override on the initial state. - set_shader(room_arc, preflect); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: event_e -// Access: Public -// Description: Toggle sphere texture -//////////////////////////////////////////////////////////////////// -void event_e(CPT_Event) { - static bool spheretex_mode = false; - - spheretex_mode = !spheretex_mode; - if (!spheretex_mode) { - // Set the normal mode on the render arc. - //clear_shader(first_arc, spheretex); - clear_shader(jack_arc, spheretex); - - } else { - // Set an override on the initial state. - //set_shader(first_arc, spheretex); - set_shader(jack_arc, spheretex); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: event_h -// Access: Public -// Description: Toggle sphere texture highlight -//////////////////////////////////////////////////////////////////// -void event_h(CPT_Event) { - static bool highlight_mode = false; - - highlight_mode = !highlight_mode; - if (!highlight_mode) { - // Set the normal mode on the render arc. - clear_shader(jack_arc, highlight); - - } else { - set_shader(jack_arc, highlight); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: event_h -// Access: Public -// Description: Toggle sphere texture reflector -//////////////////////////////////////////////////////////////////// -void event_m(CPT_Event) { - static bool sphere_reflect_mode = false; - - sphere_reflect_mode = !sphere_reflect_mode; - if (!sphere_reflect_mode) { - // Set the normal mode on the render arc. - clear_shader(jack_arc, sreflect); - - } else { - // Set an override on the initial state. - set_shader(jack_arc, sreflect); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: event_o -// Access: Public -// Description: Toggle outline shader -//////////////////////////////////////////////////////////////////// -void event_o(CPT_Event) { - static bool outline_mode = false; - - outline_mode = !outline_mode; - if (!outline_mode) { - // Set the normal mode on the render arc. - clear_shader(jack_arc, outline_shader); - - } else { - set_shader(jack_arc, outline_shader); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: setup_projtex -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void setup_projtex(void) -{ - // Create a projected texture shader - - // Put the texture projector into the scene graph - tex_proj = new LensNode("texture_projector"); - RenderRelation* proj_arc = new RenderRelation(render, tex_proj); - - // Create a trackball to spin this around. - tex_proj_trackball = new Trackball("tex_proj_trackball"); - tex_proj_trackball->set_invert(false); - tex_proj_trackball->set_rel_to(cameras); - tball2cam = new Transform2SG("tball2cam"); - tball2cam->set_arc(proj_arc); - new DataRelation(tex_proj_trackball, tball2cam); - - // Raise it and aim it at the origin - LMatrix4f proj_mat; - LPoint3f proj_pos = LPoint3f::rfu(2., 3., 8.); - LVector3f fwd_vec = proj_pos - center_pos; - look_at(proj_mat, -fwd_vec); - proj_mat.set_row(3, proj_pos); - tex_proj_trackball->set_mat(proj_mat); - proj_arc->set_transition(new TransformTransition(proj_mat)); - - // Create a shader for the texture projector - proj_shader = new ProjtexShader(tex); - proj_shader->set_priority(150); - proj_shader->add_frustum(tex_proj); - -#define DISPLAY_TEXPROJFRUST -#ifdef DISPLAY_TEXPROJFRUST - // Display a wireframe representation of the texture projector frustum - PT(Geom) proj_geom = - tex_proj->get_lens()->make_geometry(); - GeomNode* proj_geom_node = new GeomNode("proj_geometry"); - proj_geom_node->add_geom(proj_geom); - RenderRelation *prr = new RenderRelation(tex_proj, proj_geom_node); - LightTransition *plt = new LightTransition(LightTransition::all_off()); - prr->set_transition(plt); -#endif -} - -//////////////////////////////////////////////////////////////////// -// Function: setup_spotlight -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void setup_spotlight(void) -{ - // Create a projected texture spotlight shader - tex_proj_spot = new Spotlight("tex_proj_spotlight"); - //Push out the far clipping plane of the spotlight frustum - PT(Lens) lens = new PerspectiveLens; - lens->set_fov(45.0f); - lens->set_near(f._fnear); - lens->set_far(13.0f); - tex_proj_spot->set_lens(lens); - - spot_arc = new RenderRelation(render, tex_proj_spot, 10); - - // Create a trackball to spin this around. - tex_spot_trackball = new Trackball("tex_spot_trackball"); - tex_spot_trackball->set_invert(false); - tex_spot_trackball->set_rel_to(cameras); - tball2cam = new Transform2SG("tball2cam"); - tball2cam->set_arc(spot_arc); - new DataRelation(tex_spot_trackball, tball2cam); - - // Raise it and aim it at the origin - LMatrix4f spot_mat; - LPoint3f spot_pos = LPoint3f::rfu(-4., -3., 8.); - LVector3f spot_vec = spot_pos - center_pos; - look_at(spot_mat, -spot_vec); - spot_mat.set_row(3, spot_pos); - tex_spot_trackball->set_mat(spot_mat); - spot_arc->set_transition(new TransformTransition(spot_mat)); - - // Create a shader for the spotlight - spot_shader = new SpotlightShader; - spot_shader->set_priority(150); - spot_shader->add_frustum(tex_proj_spot); - -#define DISPLAY_TEXPROJSPOTFRUST -#ifdef DISPLAY_TEXPROJSPOTFRUST - // Display a wireframe representation of the spotlight frustum - Colorf color_red(1., 0., 0., 1.); - PT(Geom) frust_geom = - tex_proj_spot->get_lens()->make_geometry(); - GeomNode* frust_geom_node = new GeomNode("frustum_geometry"); - frust_geom_node->add_geom(frust_geom); - RenderRelation *rr = new RenderRelation(tex_proj_spot, frust_geom_node); - LightTransition *lt = new LightTransition(LightTransition::all_off()); - rr->set_transition(lt); -#endif - -#define DISPLAY_SHAFT -#ifdef DISPLAY_SHAFT - // Draw a light shaft for the spotlight - NamedNode* shaft = tex_proj_spot->make_geometry(0.05, 8.0, 36); - RenderRelation *sr = new RenderRelation(tex_proj_spot, shaft, 10); -#endif -} - -//////////////////////////////////////////////////////////////////// -// Function: setup_planar -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void setup_planar(void) -{ - // Create a planar reflection - Planef p(LVector3f(0., 0., 1.), LVector3f(0., 0., -10.)); - PlaneNode* plane_node = new PlaneNode; - plane_node->set_plane(p); - preflect = new PlanarReflector(plane_node); -} - -//////////////////////////////////////////////////////////////////// -// Function: setup_projshadow -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void setup_projshadow(void) -{ - // Create a projected texture shadower - proj_shadow = new ProjtexShadower; - proj_shadow->add_frustum(tex_proj_spot); - proj_shadow->set_priority(150); - if (root != (NamedNode *)NULL) { - proj_shadow->add_caster(root); - preflect->add_caster(root); - } else if (geomnode != (GeomNode *)NULL) { - proj_shadow->add_caster(geomnode); - preflect->add_caster(geomnode); - } -} - -//////////////////////////////////////////////////////////////////// -// Function: setup_vizes -// Access: Public -// Description: -//////////////////////////////////////////////////////////////////// -void setup_vizes(void) -{ - // and now for some multipass partial visualization - Shader::Visualize* v = Shader::get_viz(); - std::string viztype = min_shader.GetString("multipass-viz", "none"); - - if (viztype == "old-style") - { - PT(GraphicsWindow) w(main_win); - v = new Oldviz(w); - } - else if (viztype == "new-single") - { - PT(GraphicsPipe) p(((GraphicsPipe*)(main_win->get_pipe()))); - v = new Viztex(p); - } - else if (viztype == "new-tile") - { - PT(GraphicsPipe) p(((GraphicsPipe*)(main_win->get_pipe()))); - v = new Tiledviz(p); - } - - Shader::set_viz(v); -} - -//////////////////////////////////////////////////////////////////// -// Function: min_shader_keys -// Access: Public -// Description: Set event handlers for the various keys needed, and -// do any initialization necessary -//////////////////////////////////////////////////////////////////// -void min_shader_keys(EventHandler &eh) { - Loader loader; - - eh.add_hook("p", event_p); - eh.add_hook("s", event_s); - eh.add_hook("d", event_d); - eh.add_hook("r", event_r); - eh.add_hook("e", event_e); - eh.add_hook("h", event_h); - eh.add_hook("m", event_m); - eh.add_hook("o", event_o); - - // Load a texture to project - tex = TexturePool::load_texture("smiley.rgba"); - tex->set_minfilter(Texture::FT_linear); - tex->set_magfilter(Texture::FT_linear); - tex->set_wrapu(Texture::WM_clamp); - tex->set_wrapv(Texture::WM_clamp); - -//--------------------PROJECTED TEXTURE SHADER------------------- - setup_projtex(); -//--------------------SPOTLIGHT SHADER------------------- - setup_spotlight(); -//--------------------PLANAR REFLECTOR SHADER------------------- - setup_planar(); -//--------------------SHADOW SHADER------------------- - setup_projshadow(); -//--------------------SPHERE TEXTURE SHADER------------------- - spheretex = new SpheretexShader(tex); - spheretex->set_priority(150); -//--------------------SPHERE HIGHLIGHTER TEXTURE SHADER------------------- - highlight = new SpheretexHighlighter(32); - highlight->add_frustum(tex_proj_spot); - highlight->set_priority(150); -//--------------------SPHERE REFLECTOR TEXTURE SHADER------------------- - sreflect = new SpheretexReflector; - sreflect->add_frustum(tex_proj_spot); - sreflect->set_priority(150); - sreflect->add_caster(root); -//--------------------OUTLINE SHADER------------------- - outline_shader = new OutlineShader; - outline_shader->set_priority(150); - - // Load the room file - PT_NamedNode room = DCAST(NamedNode, loader.load_sync("big-room.egg")); - if (room != (NamedNode *)NULL) { - room_arc = new RenderRelation(render, room, 20); - - sreflect->add_caster(room); - } - - // Load jack - PT_NamedNode jack = DCAST(NamedNode, loader.load_sync("jack.egg")); - if (jack != (NamedNode *)NULL) { - jack_arc = new RenderRelation(render, jack); - LMatrix4f jack_mat = LMatrix4f::ident_mat(); - LPoint3f jack_pos = LPoint3f::rfu(-2., -2., -6.); - jack_mat.set_row(3, jack_pos); - jack_arc->set_transition(new TransformTransition(jack_mat)); - - proj_shadow->add_caster(jack); - preflect->add_caster(jack); - } - - // Load jack - PT_NamedNode smiley = DCAST(NamedNode, loader.load_sync("smiley.egg")); - if (jack != (NamedNode *)NULL) { - smiley_arc = new RenderRelation(render, smiley); - - proj_shadow->add_caster(smiley); - preflect->add_caster(smiley); - } - - // Load up a camera model to visualize our eyepoint. - PT_NamedNode camera_model = DCAST(NamedNode, loader.load_sync("camera.egg")); - if (camera_model != (NamedNode *)NULL) { - camera_model_arc = new RenderRelation(cameras, camera_model); - - sreflect->add_caster(camera_model); - proj_shadow->add_caster(camera_model); - preflect->add_caster(camera_model); - } - - // Set up a transition for the spotlight - light_transition = new LightTransition; - if (first_arc != (NodeRelation *)NULL) { - first_arc->set_transition(light_transition); - } - if (jack_arc != (NodeRelation *)NULL) { - jack_arc->set_transition(light_transition); - } - - setup_vizes(); -} - -int main(int argc, char *argv[]) { - extra_display_func = &shader_display_func; - define_keys = &min_shader_keys; - return framework_main(argc, argv); -} - diff --git a/panda/src/testbed/motion.cxx b/panda/src/testbed/motion.cxx deleted file mode 100644 index 82df463e30..0000000000 --- a/panda/src/testbed/motion.cxx +++ /dev/null @@ -1,126 +0,0 @@ -// Filename: motion.cxx -// Created by: frang (23Mar99) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "eventHandler.h" -#include "texture.h" -#include "graphicsWindow.h" -#include "graphicsStateGuardian.h" -#include "chancfg.h" -#include "notify.h" - -#include -#include "plist.h" - -extern GraphicsWindow* win; - -extern int framework_main(int argc, char *argv[]); -extern void (*extra_display_func)(); -extern void (*define_keys)(EventHandler&); - -#include -typedef plist TexList; -TexList screenshots; -typedef plist PBList; -PBList sshots; -int num_frames = 4; -int frame_num = 0; - -void motion_display_func( void ) { - GraphicsStateGuardian* g = win->get_gsg(); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - Texture* t; - PixelBuffer* p; - - if (frame_num < num_frames) { - t = new Texture; - t->_pbuffer->set_xsize(win->get_width()); - t->_pbuffer->set_ysize(win->get_height()); - p = new PixelBuffer; - p->set_xsize(win->get_width()); - p->set_ysize(win->get_height()); - p->_image = PTA_uchar(win->get_width() * win->get_height() * 4); - } else { - TexList::iterator i = screenshots.begin(); - PBList::iterator l = sshots.begin(); - for (int j=0, k=frame_num%num_frames; jcopy_texture_from(t, r); - g->copy_pixel_buffer_from(p, r); - - const RenderBuffer& rb = g->get_render_buffer(RenderBuffer::T_back); - - if (frame_num < num_frames) { - // screenshots.push_back(t); - sshots.push_back(p); - } - - // now we accumulate. Off the top of my head I have 3 plans for this: - // 1) apply the screen shots to one or several whole-screen polygon(s) with - // appropriate alpha - // 2) accumulate this into an accumulation buffer every frame - // 3) blend the new frame into the accumulation buffer, and subtractively - // blend the old one out. - - // version 2. Even this could be better if we didn't start by blowing away - // the frame we just rendered. - GLfloat d = 1. / GLfloat(screenshots.size() + 1.); - TexList::iterator i = screenshots.begin(); - PBList::iterator j = sshots.begin(); - // for (TexList::iterator i=screenshots.begin(); i!=screenshots.end(); ++i) { - for (; j!=sshots.end(); ++j) { - // t = *i; - // g->draw_texture_to(t, rb); - p = *j; - g->draw_pixel_buffer_to(p, rb); - // if (i == screenshots.begin()) - if (j == sshots.begin()) - glAccum(GL_LOAD, d); - else - glAccum(GL_ACCUM, d); - } - glAccum(GL_RETURN, 1.0); - g->end_frame(); - - ++frame_num; -} - -void event_plus(CPT_Event) { - frame_num %= num_frames++; - nout << "now blending " << num_frames << " frames." << endl; -} - -void event_minus(CPT_Event) { - frame_num %= --num_frames; - nout << "now blending " << num_frames << " frames." << endl; - // screenshots.erase(--(screenshots.end())); - sshots.erase(--(sshots.end())); -} - -void motion_keys(EventHandler& eh) { - eh.add_hook("plus", event_plus); - eh.add_hook("minus", event_minus); -} - -int main(int argc, char *argv[]) { - extra_display_func = &motion_display_func; - define_keys = &motion_keys; - return framework_main(argc, argv); -} diff --git a/panda/src/testbed/open_window.cxx b/panda/src/testbed/open_window.cxx deleted file mode 100644 index d6fb524161..0000000000 --- a/panda/src/testbed/open_window.cxx +++ /dev/null @@ -1,150 +0,0 @@ -// Filename: dxwindow.cxx -// Created by: drose (09Jan02) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "graphicsWindow.h" -#include "graphicsChannel.h" -#include "graphicsLayer.h" -#include "displayRegion.h" -#include "camera.h" -#include "perspectiveLens.h" -#include "namedNode.h" -#include "renderRelation.h" -#include "transformTransition.h" -#include "loader.h" -#include "clockObject.h" - -#ifdef USE_GLX - #include "glxGraphicsPipe.h" -#else - #include "wglGraphicsPipe.h" - #include "wdxGraphicsPipe.h" - #include "wcrGraphicsPipe.h" -#endif - - -// This program demonstrates creating a graphics window in Panda -// explicitly, without using ChanCfg as an interface wrapper. -// Normally we use ChanCfg to create the window and automatically set -// up many of its parameters. - -void -get_models(Node *root, int argc, char *argv[]) { - Loader loader; - - for (int i = 1; i < argc; i++) { - Filename filename = argv[i]; - - cerr << "Loading " << filename << "\n"; - PT_Node node = loader.load_sync(filename); - if (node == (Node *)NULL) { - cerr << "Unable to load " << filename << "\n"; - } else { - new RenderRelation(root, node); - } - } -} - - -int -main(int argc, char *argv[]) { - // First, create a GraphicsPipe. For this we need a PipeSpecifier - // to specify the parameters we want to pass to the pipe. Yeah, I - // know it's a weird way to pass parameters to an object. - - PipeSpecifier pipe_spec; - PT(GraphicsPipe) pipe; - -#ifdef USE_GLX - pipe = new glxGraphicsPipe(pipe_spec); -#else - // Yes, this is a stupid hard coded switch, but this is a test app, and - // I'm just making it easier to see the choices (and switch between them). - switch (2) { - case 1: - // ...OpenGL pipe - pipe = new wglGraphicsPipe(pipe_spec); - break; - case 2: - // ...Chromium OpenGL pipe (cr == chromium) - pipe = new wcrGraphicsPipe(pipe_spec); - break; - default: - // ...DirectX pipe - pipe = new wdxGraphicsPipe(pipe_spec); - break; - } -#endif - - // Now create a window on that pipe. - GraphicsWindow::Properties window_prop; - window_prop._xorg = 0; - window_prop._yorg = 0; - window_prop._xsize = 640; - window_prop._ysize = 480; - window_prop._title = "Window"; - // window_prop._fullscreen = true; - - PT(GraphicsWindow) window = pipe->make_window(window_prop); - - // Get the first channel on the window. This will be the only - // channel on non-SGI hardware. - PT(GraphicsChannel) channel = window->get_channel(0); - - // Make a layer on the channel to hold our display region. - PT(GraphicsLayer) layer = channel->make_layer(); - - // And create a display region that covers the entire window. - PT(DisplayRegion) dr = layer->make_display_region(); - - // Finally, we need a camera to associate with the display region. - PT(Camera) camera = new Camera; - PT(Lens) lens = new PerspectiveLens; - lens->set_film_size(640, 480); - camera->set_lens(lens); - dr->set_camera(camera); - - // Window setup is complete. Now we just need to make a scene graph - // for the camera to render. - PT_Node render_top = new NamedNode("render_top"); - camera->set_scene(render_top); - - PT_Node render = new NamedNode("render"); - NodeRelation *render_arc = new RenderRelation(render_top, render); - - // Put something in the scene graph to look at. - get_models(render, argc, argv); - - // Put the scene a distance in front of our face so we can see it. - LMatrix4f mat = LMatrix4f::translate_mat(0, 20, 0); - TransformTransition *tt = new TransformTransition(mat); - render_arc->set_transition(tt); - - - // This is our main update loop. Run for 5 seconds, then shut down. - ClockObject *clock = ClockObject::get_global_clock(); - clock->tick(); - double now = clock->get_frame_time(); - while (clock->get_frame_time() - now < 5.0) { - clock->tick(); - window->get_gsg()->render_frame(); - window->update(); - } - - cerr << "Exiting.\n"; - return (0); -} diff --git a/panda/src/testbed/rock-floor.rgb b/panda/src/testbed/rock-floor.rgb deleted file mode 100644 index 823b5fd38185163686004f8115e1dadf9647fa6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 99161 zcmeFak6+{YRquboEX&TaOWEnNlr5!{E~QvHr6MAVh($^rDbi9(ODUzLBb8EGM5I!r zn|u-`lgYBnQd&yKQi@na6cO>_G`Gmbi-=q?;^iWKW8}t*7>yBcZj90RxzCfCsk77i z{R6&_?>-)95|Yp7{W|Bo&#(7+zdu>aiNzw9EMgJ4BzONa^`-CA`F$V#)b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xz>jY9IKpG6A0*#Rq5k3r8rthS_Y3HBJ{9Koy=S ztHz@U?fgKGswlrp-ILf9?T_v6+Dp#q$F^4J689?5vIl-qHPPgu z8tjr7GsFeV;R>DH{!;HcC|i77Jxa@Amu@o2vZ=p&B&eF8o~b5KtvCCkGnlpqok_Be z-HJ}v@W}OEK%p(YgI+?v^9aSkRvmAn#^VR5QxV(~&^;1qy|men*tl!8p|>pm$eZM~7O zx0dal7lNa@0Q7lvM4U>z3ij+1L9?3e^8F3_oEnnm(p7iMIL888;rhN}EQ zE3n=rsW&Ls*QB{IL72I*4VURNgHhTbvz z`1t3PeiK!faEGZ!9{DV*1=M_4!iRfbrP^b?19w(QajNqt$VH_A$+y@Zc>kwH|w?-@q7>eTQ@ K%%tiA^Zx+oC1tw+ diff --git a/panda/src/testbed/shader_test.cxx b/panda/src/testbed/shader_test.cxx deleted file mode 100644 index 3b0c0870f6..0000000000 --- a/panda/src/testbed/shader_test.cxx +++ /dev/null @@ -1,721 +0,0 @@ -// Filename: shader_test.cxx -// Created by: -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "eventHandler.h" -#include "projtexShader.h" -#include "shaderTransition.h" -#include "renderRelation.h" -#include "nodeRelation.h" -#include "chancfg.h" -#include -#include "texGenTransition.h" -#include "colorBlendTransition.h" -#include "colorMaskTransition.h" -#include "textureTransition.h" -#include "texMatrixTransition.h" -#include "spotlightShader.h" -#include "light.h" -#include "eggLoader.h" -#include "look_at.h" -#include "transformTransition.h" -#include "geomNode.h" -#include "lightTransition.h" -#include "spotlight.h" -#include "projtexShadower.h" -#include "spheretexHighlighter.h" -#include "spheretexReflector.h" -#include "trackball.h" -#include "transform2sg.h" -#include "mouse.h" -#include "graphicsWindow.h" -#include "planarReflector.h" -#include "stencilTransition.h" -#include "plane.h" -#include "renderBuffer.h" -#include "outlineShader.h" -#include "pt_NamedNode.h" -#include "dataRelation.h" -#include "geomLine.h" - -#include "dconfig.h" - -#ifdef SHADER_VERBOSE -#include "indent.h" -#endif - -Configure(shader_test); -ConfigureFn(shader_test) { -} - -PT(LensNode) tex_proj; -PT(Trackball) tex_proj_trackball; -PT(ProjtexShader) proj_shader; -PT(ProjtexShadower) proj_shadow; -PT(SpheretexShader) spheretex; -PT(SpheretexHighlighter) highlight; -PT(SpheretexReflector) sreflect; -PT(PlanarReflector) preflect; -PT(OutlineShader) outline_shader; - -ShaderTransition shader_trans; - -PT(Spotlight) tex_proj_spot; -PT(Trackball) tex_spot_trackball; -PT(SpotlightShader) spot_shader; - -RenderRelation* room_arc; -RenderRelation* spot_arc; -RenderRelation* jack_arc; -RenderRelation* camera_model_arc; - -PT(LightTransition) light_transition; - -extern PT_NamedNode render; -extern NodeAttributes initial_state; -extern RenderRelation* first_arc; -extern PT_NamedNode lights; -extern PT_NamedNode root; -extern PT(GeomNode) geomnode; -extern PT_NamedNode cameras; -extern PT(MouseAndKeyboard) mak; - -extern void set_alt_trackball(Node *trackball); - -extern int framework_main(int argc, char *argv[]); -extern void (*extra_display_func)(); -extern void (*define_keys)(EventHandler&); - -extern PT(GraphicsWindow) main_win; - -class SomeViz : public Shader::Visualize { -public: - SomeViz(void); - virtual ~SomeViz(void); - virtual void DisplayTexture(PT(Texture)&, Shader*); - virtual void DisplayPixelBuffer(PT(PixelBuffer)&, Shader*); -protected: - typedef std::plist texlist; - typedef texlist::iterator texiter; - typedef std::plist pblist; - typedef pblist::iterator pbiter; - - texlist _texs; - pblist _pbs; -}; - -SomeViz::SomeViz(void) {} - -SomeViz::~SomeViz(void) {} - -void SomeViz::DisplayTexture(PT(Texture)& tex, Shader*) { - if (tex->has_ram_image()) - _texs.push_back(tex); - else { - GraphicsStateGuardian* g = main_win->get_gsg(); - PT(PixelBuffer) pb(new PixelBuffer); - g->texture_to_pixel_buffer(tex->prepare(g), pb); - _pbs.push_back(pb); - } -} - -void SomeViz::DisplayPixelBuffer(PT(PixelBuffer)& pb, Shader*) { - _pbs.push_back(pb); -} - -class Oldviz : public SomeViz { -public: - Oldviz(PT(GraphicsWindow)&); - virtual ~Oldviz(void); - virtual void Flush(void); -protected: - PT(GraphicsWindow) _w; -}; - -Oldviz::Oldviz(PT(GraphicsWindow)& win) : _w(win) {} - -Oldviz::~Oldviz(void) {} - -void Oldviz::Flush(void) { - GraphicsStateGuardian* g = _w->get_gsg(); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - PT(DisplayRegion) d(_w->make_scratch_display_region(256, 256)); - - for (texiter i=_texs.begin(); i!=_texs.end(); ++i) - (*i)->draw(g, d, r); - for (pbiter j=_pbs.begin(); j!=_pbs.end(); ++j) - (*j)->draw(g, d, r); - _texs.erase(_texs.begin(), _texs.end()); - _pbs.erase(_pbs.begin(), _pbs.end()); -} - -class Viztex : public SomeViz { -public: - Viztex(PT(GraphicsPipe)&); - virtual ~Viztex(void); - virtual void Flush(void); -protected: - typedef std::plist< PT(GraphicsWindow) > winlist; - typedef winlist::iterator winiter; - - winlist _wins; - PT(GraphicsPipe) _pipe; -}; - -Viztex::Viztex(PT(GraphicsPipe)& p) : _pipe(p) {} - -Viztex::~Viztex(void) {} - -void Viztex::Flush(void) { - winiter _witer = _wins.begin(); - - for (texiter i=_texs.begin(); i!=_texs.end(); ++i) { - GraphicsWindow* w; - - if (_witer == _wins.end()) { - ChanCfgOverrides override; - - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_SINGLE))); - override.setField(ChanCfgOverrides::Title, "Multipass partial"); - override.setField(ChanCfgOverrides::SizeX, 256); - override.setField(ChanCfgOverrides::SizeY, 256); - override.setField(ChanCfgOverrides::Cameras, false); - //JMC: Addeded cameras and render for parameters of ChanConfig - w = ChanConfig(_pipe, "single", (Node *)NULL, render, override); - //JMC: Removed set_active calls to channels - _wins.push_back(w); - } else { - w = *_witer; - ++_witer; - } - GraphicsStateGuardian* g = w->get_gsg(); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - PT(DisplayRegion) d(w->make_scratch_display_region(w->get_width(), - w->get_height())); - // g->prepare_display_region(d); - (*i)->draw(g, d, r); - } - for (pbiter j=_pbs.begin(); j!=_pbs.end(); ++j) { - GraphicsWindow* w; - - if (_witer == _wins.end()) { - ChanCfgOverrides override; - - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_SINGLE))); - override.setField(ChanCfgOverrides::Title, "Multipass partial"); - override.setField(ChanCfgOverrides::SizeX, 256); - override.setField(ChanCfgOverrides::SizeY, 256); - override.setField(ChanCfgOverrides::Cameras, false); - //JMC: Addeded cameras and render for parameters of ChanConfig - w = ChanConfig(_pipe, "single", cameras, render, override); - //JMC: Removed set_active calls to channels - _wins.push_back(w); - } else { - w = *_witer; - ++_witer; - } - GraphicsStateGuardian* g = w->get_gsg(); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - PT(DisplayRegion) d(w->make_scratch_display_region(w->get_width(), - w->get_height())); - // g->prepare_display_region(d); - (*j)->draw(g, d, r); - } - _texs.erase(_texs.begin(), _texs.end()); - _pbs.erase(_pbs.begin(), _pbs.end()); -} - -class Tiledviz : public Viztex { -public: - Tiledviz(PT(GraphicsPipe)&); - virtual ~Tiledviz(void); - virtual void Flush(void); -}; - -Tiledviz::Tiledviz(PT(GraphicsPipe)& p) : Viztex(p) {} - -Tiledviz::~Tiledviz(void) {} - -void Tiledviz::Flush(void) { - int count = 0; - //JMC: Added layer count - int layer_count = 0; - winiter _witer = _wins.begin(); - -#ifdef SHADER_VERBOSE - int _level = 2; - if (!_texs.empty()) - { - nout << "Tiledvid::Flush:" << endl; - } -#endif - -#ifdef SHADER_VERBOSE - if (!_texs.empty()) - { - indent(nout, _level) << "TexList Loop" << endl; - } - _level += 2; -#endif - for (texiter texi=_texs.begin(); texi!=_texs.end(); ++texi) { - GraphicsWindow* w; - DisplayRegion* d; - - if (_witer == _wins.end()) { - ChanCfgOverrides override; - - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_SINGLE))); - override.setField(ChanCfgOverrides::Title, "Multipass partial"); - override.setField(ChanCfgOverrides::SizeX, 512); - override.setField(ChanCfgOverrides::SizeY, 512); - override.setField(ChanCfgOverrides::Cameras, false); - //JMC: Addeded cameras and render for parameters of ChanConfig - w = ChanConfig(_pipe, "multipass-tile", cameras, render, override); - //JMC: Removed set_active calls to channels - _wins.push_back(w); - _witer = --(_wins.end()); - } else - w = *_witer; - - int dridx; - GraphicsStateGuardian* g = w->get_gsg(); - GraphicsChannel *chan = w->get_channel(0); - //JMC: Added call to get_layer - GraphicsLayer *layer = chan->get_layer(layer_count); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - //JMC: Removed display region iterators for GraphicsChannel. They - //no longer exist. - //JMC: Added call to get_dr -#ifdef SHADER_VERBOSE - indent(nout, _level) << "Getting display region " << count - << " from graphics layer" << endl; -#endif - d = layer->get_dr(count); - (*texi)->draw(g, d, r); - ++count; - if (count == layer->get_num_drs()) { - count = 0; - ++layer_count; - } - - if (layer_count == chan->get_num_layers()) - { - layer_count = 0; - ++_witer; - } - } -#ifdef SHADER_VERBOSE - _level -= 2; -#endif - for (pbiter pbi=_pbs.begin(); pbi!=_pbs.end(); ++pbi) { - GraphicsWindow* w; - DisplayRegion* d; - - if (_witer == _wins.end()) { - ChanCfgOverrides override; - - override.setField(ChanCfgOverrides::Mask, - ((unsigned int)(W_SINGLE))); - override.setField(ChanCfgOverrides::Title, "Multipass partial"); - override.setField(ChanCfgOverrides::SizeX, 512); - override.setField(ChanCfgOverrides::SizeY, 512); - override.setField(ChanCfgOverrides::Cameras, false); - //JMC: Addeded cameras and render for parameters of ChanConfig - w = ChanConfig(_pipe, "multipass-tile", cameras, render, override); - //JMC: Removed set_active calls to channels - _wins.push_back(w); - _witer = --(_wins.end()); - } else - w = *_witer; - - int dridx; - GraphicsStateGuardian* g = w->get_gsg(); - GraphicsChannel *chan = w->get_channel(0); - //JMC: Added call to get_layer - GraphicsLayer *layer = chan->get_layer(0); - const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front); - //JMC: Removed display region iterators for GraphicsChannel. They - //no longer exist. - //JMC: Added call to get_dr - d = layer->get_dr(count); - // g->prepare_display_region(d); - (*pbi)->draw(g, d, r); - ++count; - if (count == 16) { - count = 0; - ++_witer; - } - } - _texs.erase(_texs.begin(), _texs.end()); - _pbs.erase(_pbs.begin(), _pbs.end()); -} - -// nothing extra to do for either of these -void shader_display_func(void) { - Shader::Visualize* v = Shader::get_viz(); - if (v != (Shader::Visualize*)0L) - v->Flush(); -} - -void event_p(CPT_Event) { - // The "p" key was pressed. Toggle projected texture. - static bool projtex_mode = false; - - projtex_mode = !projtex_mode; - if (!projtex_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, proj_shader); - clear_shader(first_arc, proj_shader); - clear_shader(jack_arc, proj_shader); - - set_alt_trackball(NULL); - - } else { - // Set an override on the initial state. - set_shader(room_arc, proj_shader); - set_shader(first_arc, proj_shader); - set_shader(jack_arc, proj_shader); - - set_alt_trackball(tex_proj_trackball); - } -} - -void event_s(CPT_Event) { - // The "s" key was pressed. Toggle projected texture spotlight. - static bool projtexspot_mode = false; - - projtexspot_mode = !projtexspot_mode; - if (!projtexspot_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, spot_shader); - set_alt_trackball(NULL); - - } else { - // Set an override on the initial state. - set_shader(room_arc, spot_shader); - set_alt_trackball(tex_spot_trackball); - } -} - -void event_d(CPT_Event) { - // The "d" key was pressed. Toggle projected texture shadows. - static bool projtex_shadow_mode = false; - - projtex_shadow_mode = !projtex_shadow_mode; - if (!projtex_shadow_mode) { - // Set the normal mode on the render arc. - clear_shader(room_arc, proj_shadow); - set_alt_trackball(NULL); - - } else { - set_shader(room_arc, proj_shadow); - set_alt_trackball(tex_spot_trackball); - } -} - -void event_h(CPT_Event) { - // The "h" key was pressed. Toggle highlight. - static bool highlight_mode = false; - - highlight_mode = !highlight_mode; - if (!highlight_mode) { - // Set the normal mode on the render arc. - clear_shader(first_arc, highlight); - - } else { - set_shader(first_arc, highlight); - } -} - -void event_e(CPT_Event) { - // The "e" key was pressed. Toggle sphere texture. - static bool spheretex_mode = false; - - spheretex_mode = !spheretex_mode; - if (!spheretex_mode) { - // Set the normal mode on the render arc. - clear_shader(first_arc, spheretex); - - } else { - // Set an override on the initial state. - set_shader(first_arc, spheretex); - } -} - -void event_m(CPT_Event) { - // The "m" key was pressed. Toggle sphere reflection. - static bool sphere_reflect_mode = false; - - sphere_reflect_mode = !sphere_reflect_mode; - if (!sphere_reflect_mode) { - // Set the normal mode on the render arc. - clear_shader(first_arc, sreflect); - - } else { - // Set an override on the initial state. - set_shader(first_arc, sreflect); - } -} - -void event_r(CPT_Event) { - // The "r" key was pressed. Toggle planar reflection. - static bool plane_reflect_mode = false; - - plane_reflect_mode = !plane_reflect_mode; - if (!plane_reflect_mode) { - // Set the normal mode on the render arc. - clear_shader(first_arc, preflect); - - } else { - // Set an override on the initial state. - set_shader(first_arc, preflect); - } -} - -void event_n(CPT_Event) { - // The "n" key was pressed. Toggle the spot light. - static bool spotlight_on = false; - spotlight_on = !spotlight_on; - if (!spotlight_on) { - light_transition->set_off(tex_proj_spot.p()); - set_alt_trackball(NULL); - } else { - light_transition->set_on(tex_proj_spot.p()); - set_alt_trackball(tex_spot_trackball); - } -} - -void event_o(CPT_Event) { - // The "o" key was pressed. Toggle outlining. - static bool outline_mode = false; - - outline_mode = !outline_mode; - if (!outline_mode) { - // Set the normal mode on the render arc. - clear_shader(first_arc, outline_shader); - - } else { - set_shader(first_arc, outline_shader); - } -} - -void shader_keys(EventHandler &eh) { - eh.add_hook("p", event_p); - eh.add_hook("s", event_s); - eh.add_hook("d", event_d); - eh.add_hook("h", event_h); - eh.add_hook("e", event_e); - eh.add_hook("m", event_m); - eh.add_hook("r", event_r); - eh.add_hook("n", event_n); - eh.add_hook("o", event_o); - - LPoint3f center_pos = LPoint3f::origin(); - - // Create a projected texture shader - // Load a texture to project - Texture* tex = new Texture; - tex->read("smiley.rgba"); - tex->set_name("smiley.rgba"); - - // Put the texture projector into the scene graph - tex_proj = new LensNode("texture_projector"); - RenderRelation* proj_arc = new RenderRelation(render, tex_proj); - - // Create a trackball to spin this around. - tex_proj_trackball = new Trackball("tex_proj_trackball"); - tex_proj_trackball->set_invert(false); - tex_proj_trackball->set_rel_to(cameras); - Transform2SG *tball2cam = new Transform2SG("tball2cam"); - tball2cam->set_arc(proj_arc); - new DataRelation(tex_proj_trackball, tball2cam); - - // Raise it and aim it at the origin - LMatrix4f proj_mat; - LPoint3f proj_pos = LPoint3f::rfu(2., 3., 8.); - LVector3f fwd_vec = proj_pos - center_pos; - look_at(proj_mat, -fwd_vec); - proj_mat.set_row(3, proj_pos); - tex_proj_trackball->set_mat(proj_mat); - proj_arc->set_transition(new TransformTransition(proj_mat)); - - // Create a shader for the texture projector - proj_shader = new ProjtexShader(tex); - proj_shader->add_frustum(tex_proj); - -#define DISPLAY_TEXPROJFRUST -#ifdef DISPLAY_TEXPROJFRUST - // Display a wireframe representation of the texture projector frustum - PT(Geom) proj_geom = - tex_proj->get_lens()->make_geometry(); - GeomNode* proj_geom_node = new GeomNode("proj_geometry"); - //JMC: Removed _drawable_vector.push_back call and added add_geom - //call - proj_geom_node->add_geom(proj_geom); - RenderRelation *prr = new RenderRelation(tex_proj, proj_geom_node); - LightTransition *plt = new LightTransition(LightTransition::all_off()); - prr->set_transition(plt); -#endif - - // Create a projected texture spotlight shader - tex_proj_spot = new Spotlight("tex_proj_spotlight"); - spot_arc = new RenderRelation(render, tex_proj_spot, 10); - - // Create a trackball to spin this around. - tex_spot_trackball = new Trackball("tex_spot_trackball"); - tex_spot_trackball->set_invert(false); - tex_spot_trackball->set_rel_to(cameras); - tball2cam = new Transform2SG("tball2cam"); - tball2cam->set_arc(spot_arc); - new DataRelation(tex_spot_trackball, tball2cam); - - // Raise it and aim it at the origin - LMatrix4f spot_mat; - LPoint3f spot_pos = LPoint3f::rfu(-4., -3., 8.); - LVector3f spot_vec = spot_pos - center_pos; - look_at(spot_mat, -spot_vec); - spot_mat.set_row(3, spot_pos); - tex_spot_trackball->set_mat(spot_mat); - spot_arc->set_transition(new TransformTransition(spot_mat)); - - // Create a shader for the spotlight - spot_shader = new SpotlightShader; - spot_shader->add_frustum(tex_proj_spot); - -#define DISPLAY_TEXPROJSPOTFRUST -#ifdef DISPLAY_TEXPROJSPOTFRUST - // Display a wireframe representation of the spotlight frustum - Colorf color_red(1., 0., 0., 1.); - PT(Geom) frust_geom = - tex_proj_spot->get_lens()->make_geometry(color_red); - GeomNode* frust_geom_node = new GeomNode("frustum_geometry"); - //JMC: Removed _drawable_vector.push_back call and added add_geom - //call - frust_geom_node->add_geom(frust_geom); - RenderRelation *rr = new RenderRelation(tex_proj_spot, frust_geom_node); - LightTransition *lt = new LightTransition(LightTransition::all_off()); - rr->set_transition(lt); -#endif - -#ifdef DISPLAY_SHAFT - // Draw a light shaft for the spotlight - NamedNode* shaft = tex_proj_spot->make_geometry(0.05, 8.0, 36); - new RenderRelation(tex_proj_spot, shaft, 10); -#endif - - // Create a planar reflection - Planef p(LVector3f(0., 0., 1.), LVector3f(0., 0., -10.)); - PlaneNode* plane_node = new PlaneNode; - plane_node->set_plane(p); - preflect = new PlanarReflector(plane_node); - - // Create a projected texture shadower - proj_shadow = new ProjtexShadower; - proj_shadow->add_frustum(tex_proj_spot); - if (root != (NamedNode *)NULL) { - proj_shadow->add_caster(root); - preflect->add_caster(root); - } else if (geomnode != (GeomNode *)NULL) { - proj_shadow->add_caster(geomnode); - preflect->add_caster(geomnode); - } - - // Create a spheretex shader - spheretex = new SpheretexShader(tex); - - // Create a highlight - highlight = new SpheretexHighlighter; - highlight->add_frustum(tex_proj_spot); - - // Create a spheremap reflection - sreflect = new SpheretexReflector; - sreflect->add_frustum(tex_proj_spot); - - // Create an outline shader - outline_shader = new OutlineShader; - - // Load the room file - PT_NamedNode room = loader.load_sync("big-room.egg"); - if (room != (NamedNode *)NULL) { - room_arc = new RenderRelation(render, room, 20); - - sreflect->add_caster(room); - new RenderRelation(room, plane_node); - } - - // Load jack - PT_NamedNode jack = loader.load_sync("jack.egg"); - if (jack != (NamedNode *)NULL) { - jack_arc = new RenderRelation(render, jack); - LMatrix4f jack_mat = LMatrix4f::ident_mat(); - LPoint3f jack_pos = LPoint3f::rfu(-2., -2., 2.); - jack_mat.set_row(3, jack_pos); - jack_arc->set_transition(new TransformTransition(jack_mat)); - - sreflect->add_caster(jack); - proj_shadow->add_caster(jack); - preflect->add_caster(jack); - } - - // Load up a camera model to visualize our eyepoint. - PT_NamedNode camera_model = loader.load_sync("camera.egg"); - if (camera_model != (NamedNode *)NULL) { - camera_model_arc = new RenderRelation(cameras, camera_model); - - sreflect->add_caster(camera_model); - proj_shadow->add_caster(camera_model); - preflect->add_caster(camera_model); - } - - // Set up a transition for the spotlight - light_transition = new LightTransition; - if (first_arc != (NodeRelation *)NULL) { - first_arc->set_transition(light_transition); - } - if (jack_arc != (NodeRelation *)NULL) { - jack_arc->set_transition(light_transition); - } - - // and now for some multipass partial visualization - Shader::Visualize* v = Shader::get_viz(); - std::string viztype = shader_test.GetString("multipass-viz", "none"); - if (viztype == "old-style") { - PT(GraphicsWindow) w(main_win); - v = new Oldviz(w); - } else if (viztype == "new-single") { - PT(GraphicsPipe) p(((GraphicsPipe*)(main_win->get_pipe()))); - v = new Viztex(p); - } else if (viztype == "new-tile") { - PT(GraphicsPipe) p(((GraphicsPipe*)(main_win->get_pipe()))); - v = new Tiledviz(p); - } - Shader::set_viz(v); -} - -int main(int argc, char *argv[]) { - extra_display_func = &shader_display_func; - define_keys = &shader_keys; - return framework_main(argc, argv); -} - - - - - diff --git a/panda/src/testbed/test_eggWrite.cxx b/panda/src/testbed/test_eggWrite.cxx deleted file mode 100644 index 6c547a2d87..0000000000 --- a/panda/src/testbed/test_eggWrite.cxx +++ /dev/null @@ -1,112 +0,0 @@ -// Filename: test_eggWrite.cxx -// Created by: jason (16Jun00) -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "renderRelation.h" -#include "transformTransition.h" -#include "namedNode.h" -#include "geom.h" -#include "geomNode.h" -#include "pt_NamedNode.h" -#include "nodeTransitionWrapper.h" -#include "nodeAttributeWrapper.h" -#include "allTransitionsWrapper.h" -#include "allAttributesWrapper.h" -#include "nullTransitionWrapper.h" -#include "nullAttributeWrapper.h" -#include "traverserVisitor.h" -#include "dftraverser.h" -#include "nullLevelState.h" -#include "filename.h" -#include "character.h" - -#include "indent.h" -#include -#include "bamWriter.h" -#include "bam.h" - - -template -class PrintNodes : public TraverserVisitor { -public: - PrintNodes() { - _indent_level = 0; - } - bool reached_node(Node *node, AttributeWrapper &state, NullLevelState &) - { - indent(nout, _indent_level) << "Reached " << *node << ", state is " << state << "\n"; - // if (node->is_of_type(GeomNode::get_class_type())) -// { -// GeomNode *geomNode = (GeomNode *)node; -// int num_geoms = geomNode->get_num_geoms(); -// for (int i = 0; i < num_geoms; i++) -// { -// dDrawable *draw = geomNode->get_geom(i); -// Geom *geom = DCAST(Geom, draw); -// indent(nout, _indent_level+1) << *geom << ":\n"; -// geom->output_verbose(nout); -// } -// } - return true; - } - bool forward_arc(NodeRelation *, TransitionWrapper &, AttributeWrapper &, AttributeWrapper &, NullLevelState &) - { - _indent_level += 2; - return true; - } - void backward_arc(NodeRelation *, TransitionWrapper &, AttributeWrapper &, AttributeWrapper &, const NullLevelState &) - { - _indent_level -= 2; - } - int _indent_level; -}; - - - -int main(int argc, char* argv[]) { - if (argc < 2) - { - nout << "Need an egg file" << endl; - exit(0); - } - Filename file(argv[1]); - if (file.get_extension().compare("egg") != 0) - { - nout << "Need an egg file" << endl; - exit(0); - } - datagram_file stream(file.get_basename_wo_extension()+string(".bam")); - BamWriter manager(&stream); - - PT_NamedNode smiley = loader.load_sync(file); - - nout << "\n"; - PrintNodes pn; - df_traverse(smiley, pn, - NodeAttributeWrapper(TransformTransition::get_class_type()), - NullLevelState(), - RenderRelation::get_class_type()); - nout << "\n"; - - stream.open(file::FILE_WRITE, _bam_header); - manager.init(); - manager.write_object(smiley); - stream.close(); - - return 0; -} - diff --git a/panda/src/testbed/test_recparticles.cxx b/panda/src/testbed/test_recparticles.cxx deleted file mode 100644 index 446bc67958..0000000000 --- a/panda/src/testbed/test_recparticles.cxx +++ /dev/null @@ -1,163 +0,0 @@ -// Filename: test_recparticles.cxx -// Created by: -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "framework.h" - -#include "eventHandler.h" -#include "chancfg.h" -#include -#include "renderModeTransition.h" -#include "colorTransition.h" -#include "cullFaceTransition.h" -#include "depthTestTransition.h" -#include "depthWriteTransition.h" -#include "textureTransition.h" -#include "lightTransition.h" -#include "materialTransition.h" -#include "transformTransition.h" -#include "get_rel_pos.h" -#include "boundingSphere.h" -#include "geomSphere.h" -#include "geomNode.h" -#include "notify.h" -#include "directionalLight.h" -#include "renderRelation.h" -#include "camera.h" -#include "frustum.h" -#include "orthoProjection.h" -#include "perspectiveProjection.h" -#include "textNode.h" -#include "physicsManager.h" -#include "particleSystem.h" -#include "emitters.h" -#include "forces.h" -#include "sparkleParticleRenderer.h" -#include "pointParticleRenderer.h" -#include "spriteParticleRenderer.h" -#include "pointParticleFactory.h" -#include "particleSystemManager.h" -#include "clockObject.h" -#include "nodePath.h" -#include "memoryUsage.h" -#include "texture.h" -#include "texturePool.h" - -// physics. particle systems. - -PhysicsManager physics_manager; -ParticleSystemManager ps_manager; - -static void -event_csn_update(CPT_Event) { - float dt = ClockObject::get_global_clock()->get_dt(); - - physics_manager.do_physics(dt); - ps_manager.do_particles(dt); -} - -PT(ParticleSystem) explosion_system = new ParticleSystem(128); -PT(PointParticleFactory) explosion_factory = new PointParticleFactory; -PT(SpriteParticleRenderer) explosion_renderer = new SpriteParticleRenderer; -PT(SphereSurfaceEmitter) explosion_emitter = new SphereSurfaceEmitter; - -PT(ParticleSystem) fireworks_system = new ParticleSystem(32); -PT(PointParticleFactory) fireworks_factory = new PointParticleFactory; -PT(PointParticleRenderer) fireworks_renderer = new PointParticleRenderer; -PT(LineEmitter) fireworks_emitter = new LineEmitter; -PT(Texture) fireworks_texture; - -static void -event_add_particles(CPT_Event) { - // set up the base system - fireworks_factory->set_lifespan_base(1.5f); - fireworks_factory->set_lifespan_delta(0.5f); - fireworks_emitter->set_endpoints(LPoint3f(-2.0f, 0.0f, 0.0f), - LPoint3f(2.0f, 0.0f, 0.0f)); - fireworks_emitter->set_launch_vec(LVector3f(0.0f, 0.0f, 1.0f)); - fireworks_renderer->set_point_size(4.0f); - fireworks_renderer->set_color1(Colorf(1, 1, 1, 1)); - fireworks_renderer->set_color2(Colorf(1, 0, 0, 1)); - fireworks_renderer->set_blend_type(PP_BLEND_LIFE); - fireworks_renderer->set_blend_method(PP_BLEND_LINEAR); - fireworks_renderer->set_alpha_decay(PR_ALPHA_OUT); - fireworks_system->set_birth_rate(0.25f); - fireworks_system->set_litter_size(1); - fireworks_system->set_birth_node(render); - fireworks_system->set_emitter(fireworks_emitter); - fireworks_system->set_renderer(fireworks_renderer); - fireworks_system->set_factory(fireworks_factory); - fireworks_system->set_render_parent(render); - fireworks_system->set_spawn_on_death_flag(true); - fireworks_system->set_spawn_render_node(render); - - // set up the explosion system - explosion_factory->set_lifespan_base(1.0f); - explosion_factory->set_lifespan_delta(0.0f); - explosion_emitter->set_radius(0.1f); - explosion_emitter->set_amplitude(2.0f); - explosion_emitter->set_offset_force(LVector3f(2.0f, 0.0f, 2.0f)); - explosion_renderer->set_texture(fireworks_texture); - explosion_renderer->set_alpha_decay(PR_ALPHA_OUT); - explosion_renderer->set_color(Colorf(1, 0, 0, 1)); - explosion_system->set_birth_rate(5.0f); - explosion_system->set_litter_size(64); - explosion_system->set_template_system_flag(true); - explosion_system->set_system_grows_older_flag(true); - explosion_system->set_system_lifespan(1.0f); - explosion_system->set_emitter(explosion_emitter); - explosion_system->set_renderer(explosion_renderer); - explosion_system->set_factory(explosion_factory); - - fireworks_system->add_spawn_template(explosion_system); - - // fireworks_system->add_force(new VectorForce(0, 0, -9.8f)); - - /* - particle_system->add_spawn_template(explosion_system); - particle_system->add_spawn_template(explosion_system2); - particle_system->add_spawn_template(explosion_system3); - - particle_system->set_spawn_on_death_flag(true); - particle_system->set_birth_node(render); - particle_system->set_render_parent(render); - particle_system->set_spawn_render_node(render); - */ - - ps_manager.attach_particlesystem(fireworks_system); - physics_manager.attach_physical(fireworks_system); - - nout << "Added particles." << endl; - event_handler.add_hook("NewFrame", event_csn_update); -} - -void demo_keys(EventHandler&) { - event_handler.add_hook("p", event_add_particles); -} - -int main(int argc, char *argv[]) { - fireworks_texture = TexturePool::load_texture("firework.rgba"); - - define_keys = &demo_keys; - return framework_main(argc, argv); -} - - - - - - diff --git a/panda/src/testbed/test_sprite_particles.cxx b/panda/src/testbed/test_sprite_particles.cxx deleted file mode 100644 index 30767f99a5..0000000000 --- a/panda/src/testbed/test_sprite_particles.cxx +++ /dev/null @@ -1,308 +0,0 @@ -// Filename: test_sprite_particles.cxx -// Created by: -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "framework.h" - -#include "eventHandler.h" -#include "chancfg.h" -#include -#include "renderModeTransition.h" -#include "colorTransition.h" -#include "cullFaceTransition.h" -#include "depthTestTransition.h" -#include "depthWriteTransition.h" -#include "textureTransition.h" -#include "lightTransition.h" -#include "materialTransition.h" -#include "transformTransition.h" -#include "get_rel_pos.h" -#include "boundingSphere.h" -#include "geomSphere.h" -#include "geomNode.h" -#include "notify.h" -#include "directionalLight.h" -#include "renderRelation.h" -#include "camera.h" -#include "frustum.h" -#include "orthoProjection.h" -#include "perspectiveProjection.h" -#include "textNode.h" -#include "physicsManager.h" -#include "particleSystem.h" -#include "emitters.h" -#include "particlefactories.h" -#include "forces.h" -#include "sparkleParticleRenderer.h" -#include "pointParticleRenderer.h" -#include "lineParticleRenderer.h" -#include "geomParticleRenderer.h" -#include "spriteParticleRenderer.h" -#include "colorTransition.h" -#include "particleSystemManager.h" -#include "clockObject.h" -#include "nodePath.h" -#include "pointShapeTransition.h" -#include "texture.h" -#include "texturePool.h" -#include "physicalNode.h" -#include "forceNode.h" -#include "linearEulerIntegrator.h" - -// physics. particle systems. - -///////////////////////////////////////////////// - -// particle system manager params -#define PARTICLE_SYSTEM_MANAGER_FRAME_STEPPING 1 - -// particle system params -#define PARTICLE_SYSTEM_POOL_SIZE 1024 -#define PARTICLE_SYSTEM_BIRTH_RATE 0.02f -#define PARTICLE_SYSTEM_LITTER_SIZE 10 -#define PARTICLE_SYSTEM_LITTER_SPREAD 0 - - -///////////////////////////////////////////////// - -// particle factory selection -#define POINT_PARTICLES - -// particle renderer selection -#define POINT_PARTICLE_RENDERER -//#define SPRITE_PARTICLE_RENDERER - -// particle emitter selection -#define SPHERE_VOLUME_EMITTER - -///////////////////////////////////////////////// - -// particle factory params -#define PARTICLE_FACTORY_LIFESPAN_BASE 0.5f - -#define SPRITE_PARTICLE_RENDERER_ALPHA_DISABLE false -#define PARTICLE_RENDERER_ALPHA_MODE BaseParticleRenderer::PR_ALPHA_NONE -//#define PARTICLE_RENDERER_ALPHA_MODE BaseParticleRenderer::PR_ALPHA_IN -//#define PARTICLE_RENDERER_ALPHA_MODE BaseParticleRenderer::PR_ALPHA_OUT -//#define PARTICLE_RENDERER_ALPHA_MODE BaseParticleRenderer::PR_ALPHA_USER -//#define PARTICLE_RENDERER_USER_ALPHA 1.0 - -#if defined POINT_PARTICLE_RENDERER - #define POINT_PARTICLE_RENDERER_POINT_SIZE 1.0f -#elif defined SPRITE_PARTICLE_RENDERER - #define SPRITE_PARTICLE_RENDERER_TEXTURE_FILE "rock-floor.rgb" - #define SPRITE_PARTICLE_RENDERER_COLOR Colorf(1.0f, 1.0f, 1.0f, 1.0f) -// #define SPRITE_PARTICLE_RENDERER_X_SCALE_FLAG true -// #define SPRITE_PARTICLE_RENDERER_Y_SCALE_FLAG true - #define SPRITE_PARTICLE_RENDERER_ANIM_ANGLE_FLAG true -// #define SPRITE_PARTICLE_RENDERER_INITIAL_X_SCALE 0.1 -// #define SPRITE_PARTICLE_RENDERER_FINAL_X_SCALE 0.0 -// #define SPRITE_PARTICLE_RENDERER_INITIAL_Y_SCALE 0.0 -// #define SPRITE_PARTICLE_RENDERER_FINAL_Y_SCALE 0.5 - #define SPRITE_PARTICLE_RENDERER_NONANIMATED_THETA 45.0f - #define SPRITE_PARTICLE_RENDERER_BLEND_METHOD BaseParticleRenderer::PP_BLEND_LINEAR -// #define SPRITE_PARTICLE_RENDERER_BLEND_METHOD BaseParticleRenderer::PP_BLEND_CUBIC -// #define SPRITE_PARTICLE_RENDERER_ALPHA_DISABLE false -#endif - -// particle emitter params - -#define EMISSION_TYPE_RADIATE -//#define EMISSION_TYPE_EXPLICIT - -#define EMITTER_AMPLITUDE 1.0 - -#if defined EMISSION_TYPE_EXPLICIT - #define EXPLICIT_LAUNCH_VEC LVector3f(-1.0f, -1.0f, 1.0f) -// #define EXPLICIT_LAUNCH_VEC LVector3f(0.0f, 0.0f, 0.0f) -#elif defined EMISSION_TYPE_RADIATE - #define RADIATE_ORIGIN LPoint3f(0.0f, 0.0f, 0.0f) -#endif - -#if defined SPHERE_VOLUME_EMITTER - #define SPHERE_VOLUME_EMITTER_RADIUS 1.0f -#endif - -///////////////////////////////////////////////// - - -PhysicsManager physics_manager; -ParticleSystemManager ps_manager; - -PT(ParticleSystem) particle_system = new ParticleSystem(1024); -PT(PointParticleFactory) pf = new PointParticleFactory; -PT(SphereVolumeEmitter) pe = new SphereVolumeEmitter; - -#if defined POINT_PARTICLE_RENDERER - PT(PointParticleRenderer) pr = new PointParticleRenderer; -#elif defined SPRITE_PARTICLE_RENDERER - PT(SpriteParticleRenderer) pr = new SpriteParticleRenderer; -#endif - -PT(Texture) texture; - -PT(PhysicalNode) pn = new PhysicalNode; -PT(ForceNode) fn = new ForceNode; - -static void -event_csn_update(CPT_Event) { - float dt = ClockObject::get_global_clock()->get_dt(); - - physics_manager.do_physics(dt); - ps_manager.do_particles(dt); -} - -static void -event_add_particles(CPT_Event) { - static initialized = 0; - - // guard against additional "P" presses (bad things happen) - if(initialized) return; - initialized = 1; - - // renderer setup - pr->set_alpha_mode(BaseParticleRenderer::PR_ALPHA_USER); - pr->set_user_alpha(1.0); - - #if defined POINT_PARTICLE_RENDERER - pr->set_point_size(1.0); - #elif defined SPRITE_PARTICLE_RENDERER - pr->set_texture(texture); - #ifdef SPRITE_PARTICLE_RENDERER_COLOR - pr->set_color(SPRITE_PARTICLE_RENDERER_COLOR); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_X_SCALE_FLAG - pr->set_x_scale_flag(SPRITE_PARTICLE_RENDERER_X_SCALE_FLAG); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_Y_SCALE_FLAG - pr->set_y_scale_flag(SPRITE_PARTICLE_RENDERER_Y_SCALE_FLAG); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_ANIM_ANGLE_FLAG - pr->set_anim_angle_flag(SPRITE_PARTICLE_RENDERER_ANIM_ANGLE_FLAG); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_INITIAL_X_SCALE - pr->set_initial_x_scale(SPRITE_PARTICLE_RENDERER_INITIAL_X_SCALE); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_FINAL_X_SCALE - pr->set_final_x_scale(SPRITE_PARTICLE_RENDERER_FINAL_X_SCALE); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_INITIAL_Y_SCALE - pr->set_initial_y_scale(SPRITE_PARTICLE_RENDERER_INITIAL_Y_SCALE); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_FINAL_Y_SCALE - pr->set_final_y_scale(SPRITE_PARTICLE_RENDERER_FINAL_Y_SCALE); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_NONANIMATED_THETA - pr->set_nonanimated_theta(SPRITE_PARTICLE_RENDERER_NONANIMATED_THETA); - #endif - #ifdef SPRITE_PARTICLE_RENDERER_BLEND_METHOD - //pr->set_alpha_blend_method(SPRITE_PARTICLE_RENDERER_BLEND_METHOD); - #endif - #define SPRITE_PARTICLE_RENDERER_ALPHA_DISABLE false - #ifdef SPRITE_PARTICLE_RENDERER_ALPHA_DISABLE - pr->set_alpha_disable(SPRITE_PARTICLE_RENDERER_ALPHA_DISABLE); - #endif - #endif - - // factory setup - #ifdef PARTICLE_FACTORY_LIFESPAN_BASE - pf->set_lifespan_base(PARTICLE_FACTORY_LIFESPAN_BASE); - #endif - #ifdef PARTICLE_FACTORY_LIFESPAN_SPREAD - pf->set_lifespan_spread(PARTICLE_FACTORY_LIFESPAN_SPREAD); - #endif - #ifdef PARTICLE_FACTORY_MASS_BASE - pf->set_mass_base(PARTICLE_FACTORY_MASS_BASE); - #endif - #ifdef PARTICLE_FACTORY_MASS_SPREAD - pf->set_mass_spread(PARTICLE_FACTORY_MASS_SPREAD); - #endif - #ifdef PARTICLE_FACTORY_TERMINAL_VELOCITY_BASE - pf->set_terminal_velocity_base(PARTICLE_FACTORY_TERMINAL_VELOCITY_BASE); - #endif - #ifdef PARTICLE_FACTORY_TERMINAL_VELOCITY_SPREAD - pf->set_terminal_velocity_spread(PARTICLE_FACTORY_TERMINAL_VELOCITY_SPREAD); - #endif - - // emitter setup - #ifdef EMITTER_AMPLITUDE - pe->set_amplitude(EMITTER_AMPLITUDE); - #endif - #ifdef EMITTER_AMPLITUDE_SPREAD - pe->set_amplitude_spread(EMITTER_AMPLITUDE_SPREAD); - #endif - #ifdef EMITTER_OFFSET_FORCE - pe->set_offset_force(EMITTER_OFFSET_FORCE); - #endif - - #if defined EMISSION_TYPE_EXPLICIT - pe->set_emission_type(BaseParticleEmitter::ET_EXPLICIT); - #ifdef EXPLICIT_LAUNCH_VEC - pe->set_explicit_launch_vector(EXPLICIT_LAUNCH_VEC); - #endif - #elif defined EMISSION_TYPE_RADIATE - pe->set_emission_type(BaseParticleEmitter::ET_RADIATE); - #ifdef RADIATE_ORIGIN - pe->set_radiate_origin(RADIATE_ORIGIN); - #endif - #endif - - pe->set_radius(SPHERE_VOLUME_EMITTER_RADIUS); - - // system setup - particle_system->set_birth_rate(PARTICLE_SYSTEM_BIRTH_RATE); - particle_system->set_litter_size(PARTICLE_SYSTEM_LITTER_SIZE); - particle_system->set_litter_spread(PARTICLE_SYSTEM_LITTER_SPREAD); - particle_system->set_emitter(pe); - particle_system->set_renderer(pr); - particle_system->set_factory(pf); - - particle_system->set_render_parent(render); - - pn->add_physical(particle_system); - new RenderRelation(render, pn); - - new RenderRelation(render, fn); - - physics_manager.attach_linear_integrator(new LinearEulerIntegrator); - physics_manager.attach_physical(particle_system); - -#ifdef PARTICLE_SYSTEM_MANAGER_FRAME_STEPPING - ps_manager.set_frame_stepping(PARTICLE_SYSTEM_MANAGER_FRAME_STEPPING); -#endif - ps_manager.attach_particlesystem(particle_system); - - nout << "Added particles." << endl; - event_handler.add_hook("NewFrame", event_csn_update); -} - -void demo_keys(EventHandler&) { - new RenderRelation( lights, dlight ); - have_dlight = true; - - event_handler.add_hook("p", event_add_particles); -} - -int main(int argc, char *argv[]) { - define_keys = &demo_keys; - -#ifdef SPRITE_PARTICLE_RENDERER - texture = TexturePool::load_texture(SPRITE_PARTICLE_RENDERER_TEXTURE_FILE); -#endif - - return framework_main(argc, argv); -} diff --git a/panda/src/testbed/vrpn_demo.cxx b/panda/src/testbed/vrpn_demo.cxx deleted file mode 100644 index 26d6d69d48..0000000000 --- a/panda/src/testbed/vrpn_demo.cxx +++ /dev/null @@ -1,66 +0,0 @@ -// Filename: vrpn_demo.cxx -// Created by: -// -//////////////////////////////////////////////////////////////////// -// -// PANDA 3D SOFTWARE -// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved -// -// All use of this software is subject to the terms of the Panda 3d -// Software license. You should have received a copy of this license -// along with this source code; you will also find a current copy of -// the license at http://etc.cmu.edu/panda3d/docs/license/ . -// -// To contact the maintainers of this program write to -// panda3d-general@lists.sourceforge.net . -// -//////////////////////////////////////////////////////////////////// - -#include "framework.h" - -#include "eventHandler.h" -#include - -#include "transform2sg.h" -#include "trackerTransform.h" -#include "trackerNode.h" -#include "vrpnClient.h" -#include "dataRelation.h" -#include "renderRelation.h" -#include "namedNode.h" - -#include "trackball.h" -#include "mouseWatcher.h" - -//////////////////////////////////////////////// -//Globals -//////////////////////////////////////////////// -VrpnClient *vrpn_client; -Transform2SG *tracker2cam; -TrackerTransform *evil_transform; -TrackerNode *evil_tracker; - -//From framework -extern PT_NamedNode data_root; -extern RenderRelation* first_arc; -extern PT(Trackball) trackball; -extern PT(MouseWatcher) mouse_watcher; - -void demo_keys(EventHandler&) { - vrpn_client = new VrpnClient(string("evildyne")); - evil_tracker = new TrackerNode(vrpn_client, string("Isense"), 2); - evil_transform = new TrackerTransform("evil_transform"); - - new DataRelation(data_root, evil_tracker); - new DataRelation(evil_tracker, evil_transform); - - tracker2cam = new Transform2SG("tracker2cam"); - tracker2cam->set_arc(first_arc); - - new DataRelation(evil_transform, tracker2cam); -} - -int main(int argc, char *argv[]) { - define_keys = &demo_keys; - return framework_main(argc, argv); -}