Jump to content


Have you ever made a Lolgorithm?


32 replies to this topic

#1 Superfly Johnson

    New Member

  • Members
  • PipPip
  • 19 posts

Posted 18 January 2006 - 02:01 PM

So, with a little assignment given to my by the University, and very, very little time to do it in (over a weekend), I had to stop researching tried-and-tested techniques, and come up with my own methods: The Lolgorithm.

My assignment was to create a graphics demo of "A pearlescent car on a wet tarmac road".

Wet tarmac road, simple. Just create a reflective surface with a reflection map to change the level of reflection per pixel. Made some nice puddles, looked ace.

Pearlescent car, hmm. Many papers were skim-read (such as ATi's famous one) but we didn't have time to steal the code as it was in ASM format, one which we are too dumb to read.

So we came up with the first ever Lolgorithm. By creating a 1D texture that blended between green and purple, we used NdotL to index into this texture to give an image of the car changing colour when looking at it from different angles. This has absolutely NO likeness to real life, at all.

Post your lolgorithms here. Here's a recent one for producing heat haze:


	// LOLOLOLOLOLOLOLOLOLOLOLOLOLOL

	// O						   O

	// L	Lolgorithm Begin!	   L

	// O						   O

	// LOLOLOLOLOLOLOLOLOLOLOLOLOLOL

	float4 texcoord;

	texcoord = mul(wPos, ProjectiveTexturing);

	texcoord.x += ( 0.2 * sin(g_fMotionFactor + wPos.x * 3.141 * 1 ) / 512)  * texcoord.x;

	texcoord.y += (sin(g_fMotionFactor + wPos.y * 3.141 * 1 ) / 512)  * texcoord.y;

	// LOLOLOLOLOLOLOLOLOLOLOLOLOLOL

	// O						   O

	// L	Lolgorithm End!		   L

	// O						   O

	// LOLOLOLOLOLOLOLOLOLOLOLOLOLOL

	float4 colour = tex2Dproj( g_SceneSampler, texcoord );

	colour.w = 1.0;

	return colour;


#2 Ed Mack

    Senior Member

  • Members
  • PipPipPipPip
  • 1239 posts

Posted 18 January 2006 - 04:30 PM

I don't get it. What's the point in this lol thing?

#3 Superfly Johnson

    New Member

  • Members
  • PipPip
  • 19 posts

Posted 18 January 2006 - 05:01 PM

Ever hacked something together in an attempt to mimic an effect, algorithm, or technique?

Ever found that the code is so laughably bad and comical?

You sir, made a lolgorithm.

Welcome to the lighter side of computer programming ;)

#4 Mattias Gustavsson

    Senior Member

  • Members
  • PipPipPipPip
  • 413 posts

Posted 18 January 2006 - 05:43 PM

I don't get it either. It's just using a texture as a lookup, isn't it? Or am I missing something?

#5 TheNut

    Senior Member

  • Moderators
  • 1473 posts
  • LocationThornhill, ON

Posted 18 January 2006 - 06:03 PM

How nutty =)
http://www.nutty.ca - Being a nut has its advantages.

#6 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 18 January 2006 - 06:09 PM

I've moved this thread to the Lounge at the request of some members who considered it...rather too silly to be in the general dev area :)
reedbeta.com - developer blog, OpenGL demos, and other projects

#7 CobraLionz

    Member

  • Members
  • PipPip
  • 54 posts

Posted 18 January 2006 - 07:26 PM

This thread makes no sense. It sounds like a pun on logarithm but its not.

#8 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 18 January 2006 - 08:05 PM

well.. i once wrote an optimised rsq function for fast raytracing (yeah, the low-level-hack-days).

it wasn't that accurate. result: the whole world (in wich i could move around in realtime.. at 320x240 hehe) had something like a hyper-speed-warp. looked funny..

i think the OT thinks of such algorithms: things that work somehow, but possibly not exactly as planned, but give a nice, funny effect.

if it would not have been inline assembly in the most inner loops, i'd possibly make the iterations adjustable, thus, dynamically let the timewarp get more and less.. :D
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....

#9 Superfly Johnson

    New Member

  • Members
  • PipPip
  • 19 posts

Posted 18 January 2006 - 09:02 PM

Ah, someone else has joined the Lolgorithm club!

CobraLionz: It's a play on the word "Algorithm", not "logarithm".

http://en.wikipedia....wiki/Lolgorithm

#10 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 18 January 2006 - 10:13 PM

I'm with Cobra, I thought your finger slipped typing when I saw the subject line.
BTW, what's the "* 1" for?
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*

#11 Superfly Johnson

    New Member

  • Members
  • PipPip
  • 19 posts

Posted 18 January 2006 - 10:55 PM

You think I understand what I coded? I was just messing with variables that "looked" like they might make an effect, such as number of degrees in a circle (since i was playing with sin) and the texture size. I was probably using different values in there when doing my rigourous testing procedures.

Welcome to the Lolgorithm! It works...but I have no idea how or why, hence the comedy.

#12 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 18 January 2006 - 11:05 PM

I think monjardin means that writing a "* 1" doesn't do anything, regardless of whether you understand the surrounding code or not =D
reedbeta.com - developer blog, OpenGL demos, and other projects

#13 .oisyn

    DevMaster Staff

  • Moderators
  • 1822 posts

Posted 19 January 2006 - 01:35 AM

Well unless wPos.x is some kind of custom type with overloaded * operators, that behave totally different than we expect :)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#14 Superfly Johnson

    New Member

  • Members
  • PipPip
  • 19 posts

Posted 19 January 2006 - 08:43 AM

I was probably using different values in there when doing my rigourous testing procedures.

^^

It was probably 1 to the power of PI at one point. But when messing with the delicate lolgorithm (Hey, it makes heat haze now!) I probably forgot to take it out.

#15 Mihail121

    Senior Member

  • Members
  • PipPipPipPip
  • 1052 posts

Posted 19 January 2006 - 08:53 AM

I find the Lolgorithms a great thing and intend to use them instensively in my future source :) They seem to be fully trustful and effective! Programming shouldn't always be taken that seriously 'cause even in it's comedy form, it could give nice results, as the lolgorithms proove!

#16 geon

    Senior Member

  • Members
  • PipPipPipPip
  • 893 posts

Posted 19 January 2006 - 03:56 PM

Quote

I was just messing with variables that "looked" like they might make an effect, such as number of degrees in a circle (since i was playing with sin)

This is actueally how they made many of the shaders in "Finding Nemo".

#17 Ed Mack

    Senior Member

  • Members
  • PipPipPipPip
  • 1239 posts

Posted 19 January 2006 - 10:39 PM

Why not just call it a hack?

#18 .oisyn

    DevMaster Staff

  • Moderators
  • 1822 posts

Posted 20 January 2006 - 12:14 AM

... and there goes his everlasting fantasy of introducing a new word to the public :)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#19 Superfly Johnson

    New Member

  • Members
  • PipPip
  • 19 posts

Posted 20 January 2006 - 09:57 AM

A hack doesn't always have a comical outcome. Lolgorithms, do.

#20 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 20 January 2006 - 01:56 PM

I still don't think it is funny... :blink: at all.
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users