Author Topic: Phong Shading Converter  (Read 4603 times)

Zorchenhimer

  • Autococker
  • Posts: 2614
Phong Shading Converter
« on: November 20, 2008, 11:42:46 PM »
I originally was gonna release this alongside Abandon All Hope, but I have a feeling it's gonna be a while before that.  So I decided to release this now.  What it does is 'converts' all the specified textures in a map to use Phong shading.  Readme is included as well as the source.  Hope someone finds a use for this.

phongScript.zip
phongScript_v1.1.zip

phongScript_v1.2.zip
More bugs fixed

Perl Version
phong_perl.tar.gz


Any comments and suggestions are welcome.
« Last Edit: December 14, 2012, 05:47:56 PM by Zorchenhimer »

ViciouZ

  • Map Committee
  • Autococker
  • Posts: 2227
Re: Phong Shading Converter
« Reply #1 on: November 21, 2008, 08:40:45 AM »
Thanks a ton! Very useful for some of my maps :D

I tried to compile it on linux but ran into a few problems, so I edited main.cpp accordingly and compiled a linux version. An interesting problem was that the pause function didn't work, so I changed it to use getchar(); instead and it ran fine. Wierd. Also, the linux version is only 16.7kb, considerably smaller than the windows EXE.

Attached is the edited main.cpp and the compiled linux version.

Also, whats with it creating a huge temp file full of the characters "10" repeated for ages, then not clearing up after itself?

Zorchenhimer

  • Autococker
  • Posts: 2614
Re: Phong Shading Converter
« Reply #2 on: November 21, 2008, 09:55:59 AM »
Huge temp file?  It shouldn't be.  Is that on my version, or your Linux version?  It should be writing directly to the new file.

And I didn't think that the pause() function would work as is on Linux.  Read a bunch of issues with that.  But it was better than using system("pause").  :P

KnacK

  • Global Moderator
  • Autococker
  • Posts: 3039
Re: Phong Shading Converter
« Reply #3 on: November 21, 2008, 10:14:23 AM »


 I found this rather relevent for this discussion.

ViciouZ

  • Map Committee
  • Autococker
  • Posts: 2227
Re: Phong Shading Converter
« Reply #4 on: November 21, 2008, 10:15:12 AM »
Pause function does in fact work anyway, but it doesn't work if you enter the wrong map name, which also results in the huge temp files. You may want to fix that.

Prime24

  • VM-68
  • Posts: 128
Re: Phong Shading Converter
« Reply #5 on: November 21, 2008, 10:24:05 AM »
i agree with knack, this image helped me understand the conversation in ways no one can understand =]

Zorchenhimer

  • Autococker
  • Posts: 2614
Re: Phong Shading Converter
« Reply #6 on: November 21, 2008, 10:52:07 AM »
Haha.  I haven't seen that show in a looooooong time.

Anyway, I uploaded an updated version.  Fixed a few bugs.  Theres still a few more, but I'll fix them later.

Zorchenhimer

  • Autococker
  • Posts: 2614
Re: Phong Shading Converter
« Reply #7 on: November 24, 2008, 07:15:04 PM »
More bugs fixed.  Updated first post.

stephen schultz

  • PGP
  • Posts: 26
Re: Phong Shading Converter
« Reply #8 on: November 24, 2008, 08:38:52 PM »
looka awsome zorch,.you freaken rock

Zorchenhimer

  • Autococker
  • Posts: 2614
Re: Phong Shading Converter
« Reply #9 on: December 23, 2008, 04:38:39 AM »
So, I decided to learn Perl over the weekend.  After I did, I tried to rewrite this program in Perl.  I shaved off a little under one hundred lines from the source.  :D
I'll post it here when I get around to uploading it.

Also, ViciouZ.  This script fixes the issue the C++ version was having with your map.  If there aren't enough sets of digits, it adds them (hopefully).



For those of you who don't know what this script does, this should help:

Before


After

Rick

  • Map Committee
  • Autococker
  • Posts: 2190
Re: Phong Shading Converter
« Reply #10 on: December 23, 2008, 04:11:12 PM »
oh wow, I was about to come in this thread and ask what it actually does...But that looks sweet.

vague312

  • VM-68
  • Posts: 217
Re: Phong Shading Converter
« Reply #11 on: December 25, 2008, 10:26:31 PM »
nice!

Zorchenhimer

  • Autococker
  • Posts: 2614
Re: Phong Shading Converter
« Reply #12 on: January 02, 2009, 10:34:25 PM »
Perl Version
phong_perl.tar.gz

Bump'd.

Feel free to point out any issues.  :P