Tremulous Forum

Mods => Modding Center => Topic started by: Odin on April 18, 2008, 11:40:06 pm

Title: Tremulous-RT
Post by: Odin on April 18, 2008, 11:40:06 pm
http://patches.mercenariesguild.net/index.php?do=details&task_id=157&project=1

Latest Patch (http://tremulous.net/forum/index.php?topic=7943.msg135336#msg135336)

Requirements:

Download the patch to your Tremulous SVN source directory.
Make sure you have SVN revision 1101: svn update -r1101
Patch: patch -p0 <tremulous-rt-r1101.patch
Patch: patch -p0 <Amanieu_backport_1099.patch
cd src/rapido/
make
cd ../..
make
Your executable should be in build/release-<your os+cpu architecture(just tab through)>/.

In-game, to enable the raytracer:
/rt_mode 6
To disable:
/rt_mode -1
Modes 0-5 are for debugging purposes. rt_pixeldoubling enables half-ray rendering(one ray every two pixels instead of per-pixel, I think). rt_pixeldoubling will adversely affect picture quality(will appear blocky) for long range objects, with the benefit of (almost) double performance.

I don't know how to enable reflections in shaders(this is not documented).

Performance is directly related to screen resolution. If you get 30FPS at 640x480, you will get 15FPS at 1280x960. This patch is only useful for taking really cool screenshots or remastering videos with a raytraced version. Do not expect to be able to play with any raytraced-goodness without toning down the screen resolution(which makes everything blocky and makes the visual benefit of raytracing useless).

If your rig catches fire due to this patch I am not responsible.

(http://img158.imageshack.us/img158/4843/shot0005ov2.th.jpg) (http://img158.imageshack.us/my.php?image=shot0005ov2.jpg)
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Superpie on April 19, 2008, 12:24:00 am
MSys 1.0.10 + MinGW 3.1.01 on Windows XP Pro SP2 (plain tremulous, no other patches were applied)
Code: [Select]
$ patch -p0 < tremulous-rt07.patch
patching file `src/sdl/sdl_glimp.c'
Hunk #2 succeeded at 600 with fuzz 1 (offset 17 lines).
patching file `src/renderer/tr_raytracer.cpp'
patching file `src/renderer/tr_rttextures.h'
patching file `src/renderer/tr_local.h'
Hunk #1 succeeded at 414 (offset 1 line).
Hunk #3 succeeded at 1111 (offset -3 lines).
Hunk #5 succeeded at 1684 (offset -17 lines).
patching file `src/renderer/tr_init.c'
Hunk #1 succeeded at 149 (offset -4 lines).
Hunk #2 succeeded at 1044 (offset 17 lines).
Hunk #3 succeeded at 1135 (offset -10 lines).
Hunk #4 succeeded at 1195 (offset 17 lines).
patching file `src/renderer/tr_rtshaders.h'
patching file `src/renderer/tr_flares.c'
Hunk #1 succeeded at 372 (offset 1 line).
patching file `src/renderer/tr_bsp.c'
Hunk #1 succeeded at 1862 (offset 1 line).
patching file `src/renderer/tr_surface.c'
Hunk #1 succeeded at 64 (offset 1 line).
patching file `src/renderer/tr_rttextures.cpp'
patching file `src/renderer/tr_scene.c'
Hunk #1 succeeded at 152 (offset 1 line).
patching file `src/renderer/tr_rtshaders.cpp'
patching file `src/renderer/tr_sky.c'
Hunk #1 succeeded at 726 (offset 1 line).
patching file `src/renderer/tr_shader.c'
Hunk #1 succeeded at 2028 (offset 1 line).
patching file `src/renderer/tr_rtgroupedshader.h'
patching file `src/renderer/threadpool/threadpool/pool.hpp'
patching file `src/renderer/threadpool/threadpool/future.hpp'
patching file `src/renderer/threadpool/threadpool/scheduling_policies.hpp'
patching file `src/renderer/threadpool/threadpool/detail/future.hpp'
patching file `src/renderer/threadpool/threadpool/detail/locking_ptr.hpp'
patching file `src/renderer/threadpool/threadpool/detail/scope_guard.hpp'
patching file `src/renderer/threadpool/threadpool/detail/worker_thread.hpp'
patching file `src/renderer/threadpool/threadpool/detail/pool_core.hpp'
patching file `src/renderer/threadpool/threadpool/task_adaptors.hpp'
patching file `src/renderer/threadpool/threadpool/size_policies.hpp'
patching file `src/renderer/threadpool/threadpool/shutdown_policies.hpp'
patching file `src/renderer/threadpool/threadpool/pool_adaptors.hpp'
patching file `src/renderer/threadpool/threadpool.hpp'
patching file `src/renderer/codegen/floats.h'
patching file `src/renderer/qgl.h'
Hunk #1 succeeded at 40 (offset 1 line).
patching file `src/renderer/tr_main.c'
Hunk #1 succeeded at 823 (offset 1 line).
patching file `src/renderer/tr_shade.c'
Hunk #1 succeeded at 315 (offset 1 line).
patching file `src/renderer/tr_backend.c'
Hunk #1 succeeded at 564 (offset 1 line).
patching file `src/rapido/mailbox.h'
patching file `src/rapido/ray.h'
patching file `src/rapido/Makefile.osx'
patching file `src/rapido/xmmhelper.h'
patching file `src/rapido/dynamicscene.h'
patching file `src/rapido/interlocked.h'
patching file `src/rapido/lockbook.h'
patching file `src/rapido/matrix.h'
patching file `src/rapido/threadinghelper.h'
patching file `src/rapido/README'
patching file `src/rapido/packet.h'
patching file `src/rapido/license.txt'
patching file `src/rapido/scenegroup.h'
patching file `src/rapido/statictriangle.h'
patching file `src/rapido/rapido.h'
patching file `src/rapido/dynamicbvh.inl'
patching file `src/rapido/statickdtree.cpp'
patching file `src/rapido/dynamicbvh.h'
patching file `src/rapido/vectors.h'
patching file `src/rapido/statickdtree.h'
patching file `src/rapido/Makefile'
patching file `src/rapido/statickdtreebuilder.cpp'
patching file `src/rapido/floats.h'
patching file `Makefile'
Hunk #1 succeeded at 32 (offset -6 lines).
Hunk #2 succeeded at 130 with fuzz 1 (offset 4 lines).
Hunk #3 succeeded at 306 (offset -8 lines).
Hunk #4 succeeded at 772 (offset -2 lines).
Hunk #5 succeeded at 1278 with fuzz 2 (offset 37 lines).
Hunk #6 FAILED at 1319.
Hunk #7 succeeded at 1429 (offset -297 lines).
1 out of 7 hunks FAILED -- saving rejects to Makefile.rej

Makefile.rej
Code: [Select]
***************
*** 1288,1299 ****
 
  $(B)/tremulous.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
  $(echo_cmd) "LD $@"
- $(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) \
  $(LDFLAGS) $(LIBSDLMAIN)
 
  $(B)/tremulous-smp.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN)
  $(echo_cmd) "LD $@"
- $(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \
  $(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
 
  ifneq ($(strip $(LIBSDLMAIN)),)
--- 1319,1330 ----
 
  $(B)/tremulous.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
  $(echo_cmd) "LD $@"
+ $(Q)$(LINKER) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) \
  $(LDFLAGS) $(LIBSDLMAIN)
 
  $(B)/tremulous-smp.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN)
  $(echo_cmd) "LD $@"
+ $(Q)$(LINKER) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \
  $(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
 
  ifneq ($(strip $(LIBSDLMAIN)),)

Make with BUILD_CLIENT=1 and BUILD_RAYTRACE=1
Code: [Select]
$ make
make[1]: Entering directory `/c/msys/home/superpie/Tremulous'

Building Tremulous in build/release-mingw32-x86:
  PLATFORM: mingw32
  ARCH: x86
  COMPILE_PLATFORM: mingw32
  COMPILE_ARCH: x86
  CC: gcc

  CFLAGS:
    -MMD
    -Wall
    -fno-strict-aliasing
    -Wimplicit
    -Wstrict-prototypes
    -DUSE_ICON
    -Isrc/SDL12/include
    -DUSE_OPENAL=1
    -DUSE_OPENAL_DLOPEN
    -DUSE_CURL
    -DCURL_STATICLIB
    -m32
    -DUSE_LOCAL_HEADERS
    -DRAYTRACED
    -Isrc/rapido
    -DSVN_VERSION="1.1.0_SVN1064M"
    -DNDEBUG
    -O3
    -march=i586
    -fno-omit-frame-pointer
    -ffast-math
    -falign-loops=2
    -funroll-loops
    -falign-jumps=2
    -falign-functions=2
    -fstrength-reduce

  LDFLAGS:
    -lwsock32
    -lwinmm
    -m32

  Output:
    build/release-mingw32-x86/tremded.x86.exe
    build/release-mingw32-x86/tremulous.x86.exe
    build/release-mingw32-x86/base/cgamex86.dll
    build/release-mingw32-x86/base/gamex86.dll
    build/release-mingw32-x86/base/uix86.dll
    build/release-mingw32-x86/base/vm/cgame.qvm
    build/release-mingw32-x86/base/vm/game.qvm
    build/release-mingw32-x86/base/vm/ui.qvm

make[2]: Entering directory `/c/msys/home/superpie/Tremulous'
DED_CC src/server/sv_client.c
DED_CC src/server/sv_ccmds.c
DED_CC src/server/sv_game.c
DED_CC src/server/sv_init.c
DED_CC src/server/sv_main.c
DED_CC src/server/sv_net_chan.c
DED_CC src/server/sv_snapshot.c
DED_CC src/server/sv_world.c
DED_CC src/qcommon/cm_load.c
DED_CC src/qcommon/cm_patch.c
DED_CC src/qcommon/cm_polylib.c
DED_CC src/qcommon/cm_test.c
DED_CC src/qcommon/cm_trace.c
DED_CC src/qcommon/cmd.c
DED_CC src/qcommon/common.c
DED_CC src/qcommon/cvar.c
DED_CC src/qcommon/files.c
DED_CC src/qcommon/md4.c
DED_CC src/qcommon/msg.c
DED_CC src/qcommon/net_chan.c
DED_CC src/qcommon/net_ip.c
DED_CC src/qcommon/huffman.c
DED_CC src/qcommon/parse.c
DED_CC src/qcommon/q_math.c
DED_CC src/qcommon/q_shared.c
DED_CC src/qcommon/unzip.c
DED_CC src/qcommon/vm.c
DED_CC src/qcommon/vm_interpreted.c
DED_CC src/null/null_client.c
DED_CC src/null/null_input.c
DED_CC src/null/null_snddma.c
DED_CC src/sys/con_log.c
DED_CC src/sys/sys_main.c
AS src/asm/ftola.s
AS src/asm/snapvectora.s
AS src/asm/matha.s
DED_CC src/qcommon/vm_x86.c
WINDRES src/sys/win_resource.rc
DED_CC src/sys/sys_win32.c
DED_CC src/sys/con_win32.c
LD build/release-mingw32-x86/tremded.x86.exe
CC src/client/cl_cgame.c
CC src/client/cl_cin.c
CC src/client/cl_console.c
CC src/client/cl_input.c
CC src/client/cl_keys.c
CC src/client/cl_main.c
CC src/client/cl_net_chan.c
CC src/client/cl_parse.c
CC src/client/cl_scrn.c
CC src/client/cl_ui.c
CC src/client/cl_avi.c
CC src/qcommon/cm_load.c
CC src/qcommon/cm_patch.c
CC src/qcommon/cm_polylib.c
CC src/qcommon/cm_test.c
CC src/qcommon/cm_trace.c
CC src/qcommon/cmd.c
CC src/qcommon/common.c
CC src/qcommon/cvar.c
CC src/qcommon/files.c
CC src/qcommon/md4.c
CC src/qcommon/md5.c
CC src/qcommon/msg.c
CC src/qcommon/net_chan.c
CC src/qcommon/net_ip.c
CC src/qcommon/huffman.c
CC src/qcommon/parse.c
CC src/client/snd_adpcm.c
CC src/client/snd_dma.c
CC src/client/snd_mem.c
CC src/client/snd_mix.c
CC src/client/snd_wavelet.c
CC src/client/snd_main.c
CC src/client/snd_codec.c
CC src/client/snd_codec_wav.c
CC src/client/snd_codec_ogg.c
CC src/client/qal.c
CC src/client/snd_openal.c
src/client/snd_openal.c: In function `S_AL_SrcLoop':
src/client/snd_openal.c:532: warning: `distance' might be used uninitialized in this function
src/client/snd_openal.c: In function `S_AL_SrcUpdate':
src/client/snd_openal.c:532: warning: `distance' might be used uninitialized in this function
CC src/client/cl_curl.c
CC src/server/sv_ccmds.c
CC src/server/sv_client.c
CC src/server/sv_game.c
CC src/server/sv_init.c
CC src/server/sv_main.c
CC src/server/sv_net_chan.c
CC src/server/sv_snapshot.c
CC src/server/sv_world.c
CC src/qcommon/q_math.c
CC src/qcommon/q_shared.c
CC src/qcommon/unzip.c
CC src/qcommon/puff.c
CC src/qcommon/vm.c
CC src/qcommon/vm_interpreted.c
CC src/jpeg-6/jcapimin.c
CC src/jpeg-6/jchuff.c
CC src/jpeg-6/jcinit.c
CC src/jpeg-6/jccoefct.c
CC src/jpeg-6/jccolor.c
CC src/jpeg-6/jfdctflt.c
CC src/jpeg-6/jcdctmgr.c
CC src/jpeg-6/jcphuff.c
CC src/jpeg-6/jcmainct.c
CC src/jpeg-6/jcmarker.c
CC src/jpeg-6/jcmaster.c
CC src/jpeg-6/jcomapi.c
CC src/jpeg-6/jcparam.c
CC src/jpeg-6/jcprepct.c
CC src/jpeg-6/jcsample.c
CC src/jpeg-6/jdapimin.c
CC src/jpeg-6/jdapistd.c
CC src/jpeg-6/jdatasrc.c
CC src/jpeg-6/jdcoefct.c
CC src/jpeg-6/jdcolor.c
CC src/jpeg-6/jddctmgr.c
CC src/jpeg-6/jdhuff.c
CC src/jpeg-6/jdinput.c
CC src/jpeg-6/jdmainct.c
CC src/jpeg-6/jdmarker.c
CC src/jpeg-6/jdmaster.c
CC src/jpeg-6/jdpostct.c
CC src/jpeg-6/jdsample.c
CC src/jpeg-6/jdtrans.c
CC src/jpeg-6/jerror.c
CC src/jpeg-6/jidctflt.c
CC src/jpeg-6/jmemmgr.c
CC src/jpeg-6/jmemnobs.c
CC src/jpeg-6/jutils.c
CC src/renderer/tr_animation.c
CC src/renderer/tr_backend.c
CC src/renderer/tr_bsp.c
CC src/renderer/tr_cmds.c
CC src/renderer/tr_curve.c
CC src/renderer/tr_flares.c
CC src/renderer/tr_font.c
CC src/renderer/tr_image.c
CC src/renderer/tr_init.c
CC src/renderer/tr_light.c
CC src/renderer/tr_main.c
CC src/renderer/tr_marks.c
CC src/renderer/tr_mesh.c
CC src/renderer/tr_model.c
CC src/renderer/tr_noise.c
CC src/renderer/tr_scene.c
CC src/renderer/tr_shade.c
CC src/renderer/tr_shade_calc.c
CC src/renderer/tr_shader.c
CC src/renderer/tr_shadows.c
CC src/renderer/tr_sky.c
CC src/renderer/tr_surface.c
CC src/renderer/tr_world.c
CC src/sdl/sdl_gamma.c
CC src/sdl/sdl_input.c
CC src/sdl/sdl_snd.c
CC src/sys/con_passive.c
CC src/sys/con_log.c
CC src/sys/sys_main.c
AS src/asm/snd_mixa.s
AS src/asm/matha.s
AS src/asm/ftola.s
AS src/asm/snapvectora.s
CC src/qcommon/vm_x86.c
WINDRES src/sys/win_resource.rc
CC src/sys/sys_win32.c
CC src/sdl/sdl_glimp.c
LD build/release-mingw32-x86/tremulous.x86.exe
/bin/sh.exe: llvm-config: command not found
gcc.exe: build/release-mingw32-x86/client/tr_raytracer.o: No such file or directory
gcc.exe: build/release-mingw32-x86/client/tr_rtshaders.o: No such file or directory
gcc.exe: build/release-mingw32-x86/client/tr_rttextures.o: No such file or directory
gcc.exe: unrecognized option `-rdynamic'
make[2]: *** [build/release-mingw32-x86/tremulous.x86.exe] Error 1
make[2]: Leaving directory `/c/msys/home/superpie/Tremulous'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/c/msys/home/superpie/Tremulous'
make: *** [release] Error 2
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Odin on April 19, 2008, 05:13:17 am
It fails with the same type of errors with ioQuake3. I wonder what build environment the author has?
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Divmax on April 19, 2008, 03:38:21 pm
Updated SVN to 1064...
Patched it with Amanieu_backport_1064.patch.
Result : No error
Code: [Select]
$ patch -p0 < Amanieu_backport_1064.patch
patching file `src/game/bg_misc.c'
patching file `src/game/g_local.h'
patching file `src/game/g_active.c'
patching file `src/game/g_public.h'
patching file `src/game/bg_pmove.c'
patching file `src/game/g_weapon.c'
patching file `src/game/g_trigger.c'
patching file `src/game/g_client.c'
patching file `src/game/bg_public.h'
patching file `src/game/g_cmds.c'
patching file `src/qcommon/q_shared.h'
patching file `src/qcommon/qcommon.h'
patching file `src/qcommon/msg.c'
patching file `src/qcommon/common.c'
patching file `src/cgame/cg_syscalls.asm'
patching file `src/cgame/cg_public.h'
patching file `src/ui/ui_public.h'
patching file `src/ui/ui_syscalls.asm'
patching file `src/client/cl_console.c'
patching file `src/client/cl_keys.c'
patching file `Makefile'
Patched the SVN with raytrace.patch.
Result : Hunk error
Solution : Manually edit Makefile.
Code: [Select]
$ patch -p0 < raytrace.patch
patching file `src/sdl/sdl_glimp.c'
Hunk #2 succeeded at 600 with fuzz 1 (offset 17 lines).
patching file `src/renderer/tr_raytracer.cpp'
patching file `src/renderer/tr_rttextures.h'
patching file `src/renderer/tr_local.h'
Hunk #1 succeeded at 414 (offset 1 line).
Hunk #3 succeeded at 1111 (offset -3 lines).
Hunk #5 succeeded at 1684 (offset -17 lines).
patching file `src/renderer/tr_init.c'
Hunk #1 succeeded at 149 (offset -4 lines).
Hunk #2 succeeded at 1044 (offset 17 lines).
Hunk #3 succeeded at 1135 (offset -10 lines).
Hunk #4 succeeded at 1195 (offset 17 lines).
patching file `src/renderer/tr_rtshaders.h'
patching file `src/renderer/tr_flares.c'
Hunk #1 succeeded at 372 (offset 1 line).
patching file `src/renderer/tr_bsp.c'
Hunk #1 succeeded at 1862 (offset 1 line).
patching file `src/renderer/tr_surface.c'
Hunk #1 succeeded at 64 (offset 1 line).
patching file `src/renderer/tr_rttextures.cpp'
patching file `src/renderer/tr_scene.c'
Hunk #1 succeeded at 152 (offset 1 line).
patching file `src/renderer/tr_rtshaders.cpp'
patching file `src/renderer/tr_sky.c'
Hunk #1 succeeded at 726 (offset 1 line).
patching file `src/renderer/tr_shader.c'
Hunk #1 succeeded at 2028 (offset 1 line).
patching file `src/renderer/tr_rtgroupedshader.h'
patching file `src/renderer/threadpool/threadpool/pool.hpp'
patching file `src/renderer/threadpool/threadpool/future.hpp'
patching file `src/renderer/threadpool/threadpool/scheduling_policies.hpp'
patching file `src/renderer/threadpool/threadpool/detail/future.hpp'
patching file `src/renderer/threadpool/threadpool/detail/locking_ptr.hpp'
patching file `src/renderer/threadpool/threadpool/detail/scope_guard.hpp'
patching file `src/renderer/threadpool/threadpool/detail/worker_thread.hpp'
patching file `src/renderer/threadpool/threadpool/detail/pool_core.hpp'
patching file `src/renderer/threadpool/threadpool/task_adaptors.hpp'
patching file `src/renderer/threadpool/threadpool/size_policies.hpp'
patching file `src/renderer/threadpool/threadpool/shutdown_policies.hpp'
patching file `src/renderer/threadpool/threadpool/pool_adaptors.hpp'
patching file `src/renderer/threadpool/threadpool.hpp'
patching file `src/renderer/codegen/floats.h'
patching file `src/renderer/qgl.h'
Hunk #1 succeeded at 40 (offset 1 line).
patching file `src/renderer/tr_main.c'
Hunk #1 succeeded at 823 (offset 1 line).
patching file `src/renderer/tr_shade.c'
Hunk #1 succeeded at 315 (offset 1 line).
patching file `src/renderer/tr_backend.c'
Hunk #1 succeeded at 564 (offset 1 line).
patching file `src/rapido/mailbox.h'
patching file `src/rapido/ray.h'
patching file `src/rapido/Makefile.osx'
patching file `src/rapido/xmmhelper.h'
patching file `src/rapido/dynamicscene.h'
patching file `src/rapido/interlocked.h'
patching file `src/rapido/lockbook.h'
patching file `src/rapido/matrix.h'
patching file `src/rapido/threadinghelper.h'
patching file `src/rapido/README'
patching file `src/rapido/packet.h'
patching file `src/rapido/license.txt'
patching file `src/rapido/scenegroup.h'
patching file `src/rapido/statictriangle.h'
patching file `src/rapido/rapido.h'
patching file `src/rapido/dynamicbvh.inl'
patching file `src/rapido/statickdtree.cpp'
patching file `src/rapido/dynamicbvh.h'
patching file `src/rapido/vectors.h'
patching file `src/rapido/statickdtree.h'
patching file `src/rapido/Makefile'
patching file `src/rapido/statickdtreebuilder.cpp'
patching file `src/rapido/floats.h'
patching file `Makefile'
Hunk #1 succeeded at 32 (offset -6 lines).
Hunk #2 succeeded at 130 with fuzz 1 (offset 4 lines).
Hunk #3 succeeded at 306 (offset -8 lines).
Hunk #4 succeeded at 768 (offset -6 lines).
Hunk #5 succeeded at 1278 with fuzz 2 (offset 37 lines).
Hunk #6 FAILED at 1319.
Hunk #7 succeeded at 1425 (offset -301 lines).
1 out of 7 hunks FAILED -- saving rejects to Makefile.rej
Did make.
Result : llvm compiler missing, error!
Solution(Haven't comfirmed) : Download llvm compiler from http://llvm.org/releases/download.html
Code: [Select]
$ make
make[1]: Entering directory `/c/New folder'

Building Tremulous in build/release-mingw32-x86:
  PLATFORM: mingw32
  ARCH: x86
  COMPILE_PLATFORM: mingw32
  COMPILE_ARCH: x86
  CC: gcc

  CFLAGS:
    -MMD
    -Wall
    -fno-strict-aliasing
    -Wimplicit
    -Wstrict-prototypes
    -DUSE_ICON
    -Isrc/SDL12/include
    -DUSE_OPENAL=1
    -DUSE_OPENAL_DLOPEN
    -DUSE_CURL
    -DCURL_STATICLIB
    -m32
    -DUSE_LOCAL_HEADERS
    -DRAYTRACED
    -Isrc/rapido
    -DSVN_VERSION="1.1.0_SVN1064M"
    -DNDEBUG
    -O3
    -march=i586
    -fno-omit-frame-pointer
    -ffast-math
    -falign-loops=2
    -funroll-loops
    -falign-jumps=2
    -falign-functions=2
    -fstrength-reduce

  LDFLAGS:
    -lwsock32
    -lwinmm
    -m32

  Output:
    build/release-mingw32-x86/tremded.x86.exe
    build/release-mingw32-x86/tremulous.x86.exe
    build/release-mingw32-x86/base/gamex86.dll
    build/release-mingw32-x86/base/vm/game.qvm

make[2]: Entering directory `/c/New folder'
DED_CC src/server/sv_client.c
DED_CC src/server/sv_ccmds.c
DED_CC src/server/sv_game.c
DED_CC src/server/sv_init.c
DED_CC src/server/sv_main.c
DED_CC src/server/sv_net_chan.c
DED_CC src/server/sv_snapshot.c
DED_CC src/server/sv_world.c
DED_CC src/qcommon/cm_load.c
DED_CC src/qcommon/cm_patch.c
DED_CC src/qcommon/cm_polylib.c
DED_CC src/qcommon/cm_test.c
DED_CC src/qcommon/cm_trace.c
DED_CC src/qcommon/cmd.c
DED_CC src/qcommon/common.c
DED_CC src/qcommon/cvar.c
DED_CC src/qcommon/files.c
DED_CC src/qcommon/md4.c
DED_CC src/qcommon/msg.c
DED_CC src/qcommon/net_chan.c
DED_CC src/qcommon/net_ip.c
DED_CC src/qcommon/huffman.c
DED_CC src/qcommon/parse.c
DED_CC src/qcommon/q_math.c
DED_CC src/qcommon/q_shared.c
DED_CC src/qcommon/unzip.c
DED_CC src/qcommon/vm.c
DED_CC src/qcommon/vm_interpreted.c
DED_CC src/null/null_client.c
DED_CC src/null/null_input.c
DED_CC src/null/null_snddma.c
DED_CC src/sys/con_log.c
DED_CC src/sys/sys_main.c
DED_CC src/qcommon/vm_x86.c
DED_CC src/sys/sys_win32.c
DED_CC src/sys/con_win32.c
LD build/release-mingw32-x86/tremded.x86.exe
CC src/client/cl_cgame.c
CC src/client/cl_cin.c
CC src/client/cl_console.c
CC src/client/cl_input.c
CC src/client/cl_keys.c
CC src/client/cl_main.c
CC src/client/cl_net_chan.c
CC src/client/cl_parse.c
CC src/client/cl_scrn.c
CC src/client/cl_ui.c
CC src/client/cl_avi.c
CC src/qcommon/cm_load.c
CC src/qcommon/cm_patch.c
CC src/qcommon/cm_polylib.c
CC src/qcommon/cm_test.c
CC src/qcommon/cm_trace.c
CC src/qcommon/cmd.c
CC src/qcommon/common.c
CC src/qcommon/cvar.c
CC src/qcommon/files.c
CC src/qcommon/md4.c
CC src/qcommon/md5.c
CC src/qcommon/msg.c
CC src/qcommon/net_chan.c
CC src/qcommon/net_ip.c
CC src/qcommon/huffman.c
CC src/qcommon/parse.c
CC src/client/snd_adpcm.c
CC src/client/snd_dma.c
CC src/client/snd_mem.c
CC src/client/snd_mix.c
CC src/client/snd_wavelet.c
CC src/client/snd_main.c
CC src/client/snd_codec.c
CC src/client/snd_codec_wav.c
CC src/client/qal.c
CC src/client/snd_openal.c
src/client/snd_openal.c: In function `S_AL_SrcLoop':
src/client/snd_openal.c:532: warning: `distance' might be used uninitialized in this function
src/client/snd_openal.c: In function `S_AL_SrcUpdate':
src/client/snd_openal.c:532: warning: `distance' might be used uninitialized in this function
CC src/client/cl_curl.c
CC src/server/sv_ccmds.c
CC src/server/sv_client.c
CC src/server/sv_game.c
CC src/server/sv_init.c
CC src/server/sv_main.c
CC src/server/sv_net_chan.c
CC src/server/sv_snapshot.c
CC src/server/sv_world.c
CC src/qcommon/q_math.c
CC src/qcommon/q_shared.c
CC src/qcommon/unzip.c
CC src/qcommon/puff.c
CC src/qcommon/vm.c
CC src/qcommon/vm_interpreted.c
CC src/jpeg-6/jerror.c
CC src/jpeg-6/jmemnobs.c
CC src/renderer/tr_animation.c
CC src/renderer/tr_backend.c
CC src/renderer/tr_bsp.c
CC src/renderer/tr_cmds.c
CC src/renderer/tr_curve.c
CC src/renderer/tr_flares.c
CC src/renderer/tr_font.c
CC src/renderer/tr_image.c
CC src/renderer/tr_init.c
CC src/renderer/tr_light.c
CC src/renderer/tr_main.c
CC src/renderer/tr_marks.c
CC src/renderer/tr_mesh.c
CC src/renderer/tr_model.c
CC src/renderer/tr_noise.c
CC src/renderer/tr_scene.c
CC src/renderer/tr_shade.c
CC src/renderer/tr_shade_calc.c
CC src/renderer/tr_shader.c
CC src/renderer/tr_shadows.c
CC src/renderer/tr_sky.c
CC src/renderer/tr_surface.c
CC src/renderer/tr_world.c
CC src/sdl/sdl_gamma.c
CC src/sdl/sdl_input.c
CC src/sdl/sdl_snd.c
CC src/sys/con_passive.c
CC src/sys/con_log.c
CC src/sys/sys_main.c
CC src/qcommon/vm_x86.c
CC src/sys/sys_win32.c
CC src/sdl/sdl_glimp.c
LD build/release-mingw32-x86/tremulous.x86.exe
/bin/sh.exe: llvm-config: command not found
g++.exe: build/release-mingw32-x86/client/tr_raytracer.o: No such file or directory
g++.exe: build/release-mingw32-x86/client/tr_rtshaders.o: No such file or directory
g++.exe: build/release-mingw32-x86/client/tr_rttextures.o: No such file or directory
g++.exe: unrecognized option `-rdynamic'
make[2]: *** [build/release-mingw32-x86/tremulous.x86.exe] Error 1
make[2]: Leaving directory `/c/New folder'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/c/New folder'
make: *** [release] Error 2
I'm now downloading the LLVM binaries for mingw.

EDIT: I have no idea how to setup llvm :( Btw, I assume the author is using Mac OS X from the makefile, as only that area has LLVM_CONFIG=/usr/local/bin/llvm-config
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Odin on April 19, 2008, 06:10:58 pm
In Ubuntu, I simply did apt-get install llvm.

^^^ This does not work! ^^^
The rt patch will not compile with Ubuntu's llvm package.
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Odin on May 03, 2008, 06:06:42 pm
tremulous-rt-r1085.patch (http://megatog615.chozosanctuary.com/tremulous/tremulous-rt-r1085.patch)
Instructions:
1. Get the patch above.
2. Get svn revision 1085.
3. Patch.
4. Optionally patch with the backport.
5. Enter src/rapido/
6. "make"
7. cd ../../
8. "make"

I still can't get it to compile. Stephen Reiter said to get the latest LLVM, but the latest LLVM does not have a header(LLVMBuilder.h) that the rt patch requires. The "latest LLVM" is too new for the rt patch. I'm still trying to figure out which revision he used to build it on his system. Other than that, I am very close to getting it working.

Some details:
You must use a 64-bit Linux OS. Rapido will not compile on x86. Only x86-64, and only on Linux(Win32 port hasn't been updated in a while, he says). You must compile Rapido first(e.g. enter src/rapido/ and type "make", then go back to the svn root then type "make" to build Tremulous).
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: benmachine on May 03, 2008, 09:09:33 pm
I posted about this on the mailing list, too. Try LLVM SVN rev 49000, which was around when he originally posted on the mailing list (you can check with svn log | less)

About the rapido thing, you can use make -C src/rapido to save yourself a little effort.

Perhaps now that I'm on ubuntu I'll try to work this out again, but on my Mac rapido failed me.
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Odin on May 05, 2008, 05:37:58 am
I got it to work! However, all I get is a white rendering. According to Stephen Reiter, this is supposed to happen when the shaders fail to run.

Well, the same unmodified patch works fine in ioquake3(as I tested it), so I have no idea what's wrong with this. Is there something different in Tremulous renderer-wise than ioquake3? I did a diff of ioquake3's tr_local.h with Tremulous' tr_local.h and got a couple of differences(like the r_width/height/pixelaspect changes from r_mode). Could the resolution cvars be what's causing it?

Quote from: Stephen Reiter
I'm pretty sure that this has nothing to do with everything being
rendered white. The problem must be in one of the functions dealing
with shader creation and compilation.
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Odin on May 05, 2008, 06:10:04 pm
It works. Set cg_shadows to anything other than 2 and raytracing will render correctly.
A couple screenshots:
http://megatog615.chozosanctuary.com/tremulous/base/screenshots/shot0476.jpg
http://megatog615.chozosanctuary.com/tremulous/base/screenshots/shot0477.jpg
http://megatog615.chozosanctuary.com/tremulous/base/screenshots/shot0478.jpg
http://megatog615.chozosanctuary.com/tremulous/base/screenshots/shot0479.jpg
http://megatog615.chozosanctuary.com/tremulous/base/screenshots/shot0480.jpg
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Amtie on May 06, 2008, 12:34:00 am
Sweet! Love that lasgun effect.

Is this going to be a mod or an implementation into 1.2 (likely not, but asking doesn't hurt)?
Title: Re: Porting the ioQuake3 Raytrace Patch
Post by: Odin on May 06, 2008, 12:38:51 am
No and no.

I get 3 FPS at 1280x1024 on an AMD Athlon 64 X2 5600+(video card has nothing to do with it since raytracing is done on the CPU).

Another screenshot of Uncreation:
http://megatog615.chozosanctuary.com/tremulous/base/screenshots/shot0485.jpg
Title: Tremulous-RT
Post by: Odin on August 01, 2008, 08:22:29 am
Raytrace patch updated to Tremulous revision 1101. Nothing is different, just updated to patch cleanly on the latest revision.

right-click -> save-as (http://patches.mercenariesguild.net/index.php?getfile=783)

First post updated with simple build tutorial.
Title: Re: Tremulous-RT
Post by: Survivor on August 01, 2008, 11:09:30 pm
Not to hit on you or anything, but isn't raytracing supposed to produce realistic lighting? What is the use of just having something which seems like fullbright but isn't as strong and wasting this many resources on it?
Title: Re: Tremulous-RT
Post by: Thorn on August 01, 2008, 11:12:48 pm
An insult to tremulous's renderer. If you're going to release a renderer that runs at 1/100'th of the framerate of the original renderer, atleast make it somewhat worth it. That looks like a complete abomination. What you've got there is a ray-traced client that doesn't ray trace yet still runs at 2fps. Nice job.
Title: Re: Tremulous-RT
Post by: Bomb on August 02, 2008, 12:08:26 am
I have to ask, what does this actually do?
Title: Re: Tremulous-RT
Post by: Odin on August 02, 2008, 04:15:50 am
An insult to tremulous's renderer. If you're going to release a renderer that runs at 1/100'th of the framerate of the original renderer, atleast make it somewhat worth it. That looks like a complete abomination. What you've got there is a ray-traced client that doesn't ray trace yet still runs at 2fps. Nice job.
I didn't write it. All I did was port it, because I thought it looked cool. It was made by Stephan Reiter, as you would have found out if you had read the contents of the link in the first line of the original post.

Don't flame me about it not looking like a real raytracer. I didn't fucking write it. If you have nothing constructive to say at all, don't post it. I posted screenshots if it in action. If you don't like it, don't try it. If you have nothing better to do than flame me for making somebody else's project work on Tremulous then you seriously need to reconsider your reason for being on the internet in the first place.

I know it doesn't look nice but it's at least something. It *is* raytracing, but it does not cast shadows. You can actually do realistic reflection effects with this but I have yet to find out how. Why not do something constructive for once and help me out?
Title: Re: Tremulous-RT
Post by: Taiyo.uk on August 02, 2008, 05:14:00 am
A more deeply recursive (read: shadow casting) raytracer might get three frames per minute, not three per second. Also, the fugly lighting in the screenshots could be due to how the raytracing implementation finds light sources - does it understand the shader lights and interpret the corresponding surfaces as light-emitting or does it rely on light entities and/or the lightgrid?

Practicality for gameplay is not important at this stage of development since that is not the intention. It's an interesting start, but like rasterisation (GL, D3D, etc.), raytracing lends itself to massive parallelisation, which doesn't spell love for regular x86 processors - for example, in June, Intel got ETQW running at 720p resolution at 14 to 29fps on a sixteen core, 2.93 GHz system using techniques described here: http://graphics.stanford.edu/papers/metro/metro.pdf and this lot got Q3 raytraced on a 32-node cluster in 2005: http://graphics.cs.uni-sb.de/~sidapohl/egoshooter/ "about 20 fps@36 GHz in 512x512 with 4xFSAA"

It'd be interesting to see whether contemporary programmable (and very parallel) GPUs can accelerate raytracing.
Title: Re: Tremulous-RT
Post by: Odin on August 02, 2008, 06:13:59 am
Raytracing with GPGPU does exist and is very fast compared to CPU raytracing. There's a video here(in real-time): http://www.youtube.com/watch?v=n3DfQfNHmdE

Reiter told me he did not use the lightgrid, and that light was simply "hacked on" to get it working. I don't really know how lighting is done. The more recent(unreleased) code apparently does shadows and uses the lightgrid. Here's a video for that: http://www.youtube.com/watch?v=TbQ47dKHHI8
Title: Re: Tremulous-RT
Post by: googles on August 03, 2008, 02:52:52 am
An insult to tremulous's renderer. If you're going to release a renderer that runs at 1/100'th of the framerate of the original renderer, atleast make it somewhat worth it. That looks like a complete abomination. What you've got there is a ray-traced client that doesn't ray trace yet still runs at 2fps. Nice job.

Kid, shut the fuck up. If you arn't going to help ANYONE here you have no reason to be posting in this thread

@Odin

Love all your visual ports, VERY nice ports. I'll be attempting this patch soon.
Title: Re: Tremulous-RT
Post by: googles on August 03, 2008, 05:34:24 am
Nice but isn't worth the fps usage, also this will show other side of walls when a impact mark is on them(shoot a wall, instant wallhack)

I also had a problem with compiling llvm, if any of you are check out http://article.gmane.org/gmane.comp.compilers.llvm.cvs/31739 for a fix to Target.cpp
Title: Re: Tremulous-RT
Post by: Lava Croft on August 03, 2008, 08:35:41 am
I wonder, can you actually connect to any 1.1.0 server with this client?
Title: Re: Tremulous-RT
Post by: SlackerLinux on August 03, 2008, 09:22:52 am
Nice but isn't worth the fps usage, also this will show other side of walls when a impact mark is on them(shoot a wall, instant wallhack)

I also had a problem with compiling llvm, if any of you are check out http://article.gmane.org/gmane.comp.compilers.llvm.cvs/31739 for a fix to Target.cpp

in his first post he said its kinda useless to play with and is really only useful for taking cool screen shots its still an interesting client
Title: Re: Tremulous-RT
Post by: Odin on August 04, 2008, 03:01:58 am
I wonder, can you actually connect to any 1.1.0 server with this client?
Yes. It's how I took the screenshot in the original post.

Quote from: googles
Nice but isn't worth the fps usage, also this will show other side of walls when a impact mark is on them(shoot a wall, instant wallhack)
I know, the renderer doesn't render some shaders correctly. Shaders with tcMod rotate don't render correctly and decals cause z-fighting(which is in the case of this raytracer what causes the "wallhack" issue). I figure it won't be a problem anyway due to the high performance requirement to actually render the game, any cheater would rather use a more "conventional" wallhack anyway.
Title: Re: Tremulous-RT
Post by: Lava Croft on August 04, 2008, 07:12:47 am
I wonder, can you actually connect to any 1.1.0 server with this client?
Yes. It's how I took the screenshot in the original post.

this will show other side of walls when a impact mark is on them(shoot a wall, instant wallhack)

This means Tremulous-RT is a 'cheat' client and such things are not allowed on this forum. Just like clients that disable sv_pure.
Title: Re: Tremulous-RT
Post by: Odin on August 04, 2008, 11:23:51 pm
No, it's not intended for cheating. It never was. Rendering is too slow to be useful for actually playing with so it has no use for actual cheating. Not to mention it crashes when loading complex maps, so it can only render certain maps anyway.

I think you're trying too hard, Lava.
Title: Re: Tremulous-RT
Post by: Lava Croft on August 04, 2008, 11:25:41 pm
The intent is not what matters, it's the actual result. The result is a client that could be used to cheat.
Title: Re: Tremulous-RT
Post by: Odin on August 04, 2008, 11:26:53 pm
You can cheat on any client.
Title: Re: Tremulous-RT
Post by: frak on August 05, 2008, 06:15:09 am
The intent is not what matters, it's the actual result. The result is a client that could be used to cheat.

It's hard to cheat at 2fps. You can see through walls, but doing anything with it is somewhat useless since the wall didn't just disappear. You can still run into the wall. Going around the wall was hard (for at least me) since I've just run into another wall. As a second choice of attack, telling my team would be difficult since chat/voip it lags with it. I guess Teamspeak would help, but the number of users how have it is low, and the alien/human may have already been gone/detected already.

I will one day fully code a multi-core compliant trem, port this over, start up my super computer, and show those Crysis fanboys who's boss.  ::)

P.S. nothing against who made it/ported it/improved it/etc/etc/etc, but it seems to make trem look kinda dead. You know, that creepy dim daylight that a flashlight still makes a better path sorta thing.
Title: Re: Tremulous-RT
Post by: Taiyo.uk on August 05, 2008, 09:22:26 am
Quote
P.S. nothing against who made it/ported it/improved it/etc/etc/etc, but it seems to make trem look kinda dead. You know, that creepy dim daylight that a flashlight still makes a better path sorta thing.

Quote
Reiter told me he did not use the lightgrid, and that light was simply "hacked on" to get it working. I don't really know how lighting is done. The more recent(unreleased) code apparently does shadows and uses the lightgrid. Here's a video for that: http://www.youtube.com/watch?v=TbQ47dKHHI8

The "dead" look is due to the "dead" lighting - none of the map lights were used in the version of the renderer used to take those screenshots.
Title: Re: Tremulous-RT
Post by: Jalaco on August 05, 2008, 10:54:19 am
I know enough of coding to compile clients and skrew with the weapons.particle script, but from the sound of it the ray tracing is having trouble finding the light sources correctly. Would it be impossible/stupid, to port over the way bloom detects lights? Because at least in the FSM client bloom works great (Until I broke it >_<), and it finds the lights sources good.

\\^// Jalaco \\^//
Title: Re: Tremulous-RT
Post by: doomagent13 on August 05, 2008, 04:13:57 pm
At least for the uncreation screenshot, it makes it look like ambient lighting is used... (For all I know, it might be...)
Title: Re: Tremulous-RT
Post by: Odin on August 05, 2008, 06:51:57 pm
Bloom doesn't find lights. It copies the rendered frame, resizes it, sends it through a bright pixel filter, blurs it, then stretches it over top of the main frame. Raytracers have light sources, it's just the current code does not use any(lightgrid would be perfect for the job though).

Here's the video again of the current code:
http://www.youtube.com/watch?v=TbQ47dKHHI8

Notice the shadows.

Raytracing doesn't "do ambience", it just appears as a result. It's very comparable to real light in how it bounces and fades. Light sources are made by the camera rays bouncing off of them and returning to the camera as bright lights. So it's actually the opposite in how light rays work in real life, but gives the same result(and is much faster than just having infinite amounts of rays casting from light sources).

The amount of rays cast from the camera are actually your screen resolution, so that is why your screen resolution is directly related to rendering speed. If you use 1280x1024, then you're casting 1280 times 1024 = 1310720 rays(one ray per pixel).
Title: Re: Tremulous-RT
Post by: googles on August 06, 2008, 09:01:15 pm
For the ones that haven't even tried the client, the wallhack isn't a cheat, your seeing to the other side of a wall, with maps like tremor, you cannot even see through that because there are other walls in the way. Some of you might lag a bit and fall from a very high height as a granger, and when you hit the floor for a split second you can see through the floor, that is what this is like, you cannot see players through it.