# Makefile for nvidia opengl sdk example to compile under Cygwin
# c program files nvidia or so, assuming sdk and cg thereunder
nvidiadir=../../../../../
#ccopts:= -mno-cygwin -O3
ccopts:= -mno-cygwin
libdirs:= -L $(nvidiadir)/SDK\ 9.5/LIBS/lib/Release \
-L $(nvidiadir)/Cg/lib \
/usr/lib/mingw/libcoldname.a
incs1:= -I $(nvidiadir)/SDK\ 9.5/inc/ -I $(nvidiadir)/SDK\ 9.5/DEMOS/OpenGL/inc \
-I $(nvidiadir)/SDK\ 9.5/LIBS/inc/ -I $(nvidiadir)/SDK\ 9.5/Cg/include
incs2:= -I $(nvidiadir)/SDK\ 9.5/DEMOS/OpenGL/inc -I $(nvidiadir)/SDK\ 9.5/inc/ \
-I $(nvidiadir)/SDK\ 9.5/LIBS/inc/
all: simple_soft_shadows.exe
simple_soft_shadows: simple_soft_shadows.exe
simple_soft_shadows.exe: nv_png.o read_text_file.o pbuffer.o data_path.o \
array_texture.o simple_soft_shadows.o ppm.o
g++ $(ccopts) -o simple_soft_shadows.exe \
nv_png.o read_text_file.o pbuffer.o data_path.o \
array_texture.o simple_soft_shadows.o ppm.o \
$(libdirs) \
-lpngMTDLL -lzlib -lglut32 -lglu32 -lopengl32 -lgdi32 -lcg -lm
simple_soft_shadows.o: simple_soft_shadows.cpp
g++ $(ccopts) $(incs2) -c simple_soft_shadows.cpp
nv_png.o: ../shared/nv_png.cpp
g++ $(ccopts) $(incs1) -c ../shared/nv_png.cpp
array_texture.o: ../shared/array_texture.cpp
g++ $(ccopts) $(incs1) -c ../shared/array_texture.cpp
data_path.o: ../shared/data_path.cpp
g++ $(ccopts) $(incs1) -c ../shared/data_path.cpp
pbuffer.o: ../shared/pbuffer.cpp
g++ $(ccopts) $(incs1) -c ../shared/pbuffer.cpp
read_text_file.o: ../shared/read_text_file.cpp
g++ $(ccopts) $(incs1) -c ../shared/read_text_file.cpp
ppm.o: ppm.c
g++ $(ccopts) -c ppm.c
clean:
rm -f *.o core
realclean:
rm -f *.o simple_soft_shadows.exe core
gcc -mno-cygwin -I ../../include/ -o cgGL_vertex_example2.exe cgGL_vertex_example.c \assuming it is in the SDK file tree with cg installed under the same main dir.
-L ../../lib/ -lglut32 -lglu32 -lopengl32 -lgdi32 -lm -lcg -lcgGL -Wl,--subsystem,windows
~/Opengl/runtime_ogl [1085] $ ./cgGL_vertex_example
LAST LISTING----(null)----
---- PROGRAM BEGIN ----
!!VP1.1
# NV_vertex_program generated by NVIDIA Cg compiler
# cgc version 1.4.0000, build date Sep 26 2005 22:19:13
# command line args: -q -profile vp20 -entry main
# source file: cgGL_vertex_example.cg
# nv30vp backend compiling 'main' program
#vendor NVIDIA Corporation
#version 1.0.02
#profile vp20
#program main
#semantic main.Kd
#semantic main.ModelViewProj
#var float4 Kd : : c[4] : 1 : 1
#var float4x4 ModelViewProj : : c[0], 4 : 2 : 1
#var float4 IN.position : $vin.POSITION : ATTR0 : 0 : 1
#var float3 IN.normal : $vin.NORMAL : ATTR2 : 0 : 0
#var float3 IN.color : $vin.DIFFUSE : ATTR3 : 0 : 0
#var float3 IN.TestColor : $vin.SPECULAR : ATTR4 : 0 : 1
#var float4 main.HPOS : $vout.POSITION : HPOS : -1 : 1
#var float4 main.COL0 : $vout.COLOR0 : COL0 : -1 : 1
#const c[5] = 1 0 0 0
DP4 o[HPOS].x, c[0], v[0];
DP4 o[HPOS].y, c[1], v[0];
DP4 o[HPOS].z, c[2], v[0];
DP4 o[HPOS].w, c[3], v[0];
MUL o[COL0].xyz, c[4].xyzx, v[4].xyzx;
MOV o[COL0].w, c[5].x;
END
# 6 instructions
# 0 temp registers
---- PROGRAM END ----
g++ -o demo demo.cpp -L /usr/lib64 -lglut -lCg -lCgGL -lpthread -lmassuming Cg is installed. The source of the adapted example is here. After compiling, make sure it can find a sufficient large set of imput images which it will read in as movie-texture, which is here in the code, and make a movie of the resulting jpeg images:
ffmpeg -i test.avi -me full -cropleft 128 -cropright 128 -croptop 32 -cropbottom 32 \
-deinterlace -s 512x512 -aspect 1.0 -b 15000 -t 15 -y test.mp4
mplayer -nosound -ss 00:05.0 -frames 361 -vo jpeg:quality=90:maxfiles=1000 test.mp4
./demowebani
exec ffmpeg -i imageout%d.jpg -b 5000 -y animation.mp4