• Welcome to Dark Bit Factory & Gravity.
 

W.I.P. - rbraz Texture Generator

Started by Rbz, January 18, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Rbz

Here's the progress with my own texture generator, doing this was really really fun  ;D, I've learned some new things and there's alot to learn in that area ...
My next step is to code a framework for it a make the texture development much more easy, and perhaps a couple more effects :).

Here's some images:
http://www.rbraz.com/temp/0to5.png

http://www.rbraz.com/temp/6to11.png

http://www.rbraz.com/temp/12to17.png

Function list:

Generators:
   sineplasma(0,10.0f,0);
   envmap(1,1);
   noise(2,3);
   checkerboard(3,c1,c2);
   subplasma(4,64,255,1,2);
   xor(5);
   wood(6,2);
   fractalplasma(7,1,64,128,1,2.0f,c3,4);

Distortion effects:
   sinedistort(8, 3, 1.0f, 1.0f, 20, 20);
   twirl(9, 7, 1.0f);
   mapdistort(10, 7, 4, 2);

Pixel Colour Operations:
   colorInvert(11, 7, 3);
   alphaBlending(12, 3, 1, 0.3f);
   textureShading(13, 7, 2);
   edgeDetection(14, 7, 20);
   textureEmboss(15, 3);
   textureBlur(17,14);

Resource links:
http://www.gamedev.net/reference/articles/article1994.asp
http://in4k.untergrund.net/html_articles/hugi%2018%20-%20cogentex.htm
http://in4k.untergrund.net/html_articles/hugi%2019%20-%20pxgen.htm



Challenge Trophies Won:

rdc

I love the map distort and emboss. Great work man.

mind

#2
a few things..

lose the second noise, trust me its a waste of space.. then normal noise function can be used for pretty much anything. also, do what i just did, lose the fractalplasma and implement a simple perlin noise instead (8 subplasmas at different amps and sizes added together), sure it's slower but looks so much better and is so much easier to control.

your shade looks faulty, as do your twirl.. however the twirl might be set to a radius far larger than 256?

thats what hit me when i first looked at the pictures.. other than that, great job.. have some K :)

eidt: and trust me, you will never ever use that edge detect.. so use those bytes on something different :)

and in case your shade really is faulty(could be that you used a crappy map to shade with, thus it will look faulty) here's how you implement a real shade:

loop through x and y, pop the color of map[x,y] into some variable like temp. if it's less than or equal to 127 you subtract temp from 127, add that result to source[x,y] and whack it in your destination texture at [x,y]. if temp is greater than 127 you subtract 127 from temp, add it to source[x,y] and whack it onto destination[x,y]. something like this:

x1=0 to 65535
begin
  if [map]^[x1] <= 127 color = [src]^[x1] - (127 - [map]^[x1]);

  if [map]^[x1] >= 128 color = [src]^[x1] + ([map]^[x1] - 127);

  [dest]^[x1] = color;
end


using that you will end up with something like this(3 images attached, first=source, second=source embossed, third=source shaded with emboss):

Challenge Trophies Won:

benny!

[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Shockwave

Nice looking textures Rbraz and props for generating a wood one. I had been wondering what you were up to lately  :)
Shockwave ^ Codigos
Challenge Trophies Won:

Ghost^BHT

Excellent work!  :clap:  Hope you can make a prod using this stuff

Clyde

You busy beaver you! Congrats Rbraz bud, looks triffick :)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

taj

what to say...64k here comes codigo!

karma++ too..
Challenge Trophies Won:

ekoli

Nice going! Some of the standard generators which can be used for generating a whole bunch of nice textures.
The one effect I know I wouldn't use of those is the xor effect, feels a little bit to much 256b. :D

mind had some really nice ideas there which you should listen too but if you feel that you want your edge detection you can implement a 3x3 kernel filter. That way you can make a whole bunch of sharpening/bluring and edge detection effects really simple. I use my kernel filter a lot so I wouldn't wanna live without it. :) Ofcourse it's possible to make a 5x5 or 7x7 kernel filter but then parameter data starts to grow and you can simulate larger kernels by iterating the smaller one. It looks ok in almost all cases.

Please continue and give us more effects, I really like to watch other peoples texture generators since I enjoy working with textures aswell.

Rbz

Thanks dudes, I really hope use this to do something in the near future!

@mind: For the texture shading I'm using this code:

c3.r = (int)(c1.r * (int)(c2.r / 256.0)) & 255;
c3.g = (int)(c1.g * (int)(c2.g / 256.0)) & 255;
c3.b = (int)(c1.b * (int)(c2.b / 256.0)) & 255;

I will try that other way you told me...

About the twirl, I will take a look at it and fix it...
For the fractalplasma, I'm using that one described by Ile/Aardbei , 08 subplasma added together...

@all:
Many thanks for your advice/tips, much appreciated!

Challenge Trophies Won:

mind

Quote from: rbraz on January 18, 2007
Thanks dudes, I really hope use this to do something in the near future!

@mind: For the texture shading I'm using this code:

c3.r = (int)(c1.r * (int)(c2.r / 256.0)) & 255;
c3.g = (int)(c1.g * (int)(c2.g / 256.0)) & 255;
c3.b = (int)(c1.b * (int)(c2.b / 256.0)) & 255;

I will try that other way you told me...

About the twirl, I will take a look at it and fix it...
For the fractalplasma, I'm using that one described by Ile/Aardbei , 08 subplasma added together...

@all:
Many thanks for your advice/tips, much appreciated!



ahh i see.. thats what i meant when i said that you should implement some form of perlin noise instead, thats usually how noise is defined even though it isnt REAL perlin noise it's pretty close.. i thought you were using a standard subdivision fractal plasma :)

and yeah, ekoli had a point there on the xor texture.. i still have it in my texture simply because it's basically the same as checkerboard and thus i have em in the same function, just passing a byte to decide which one to generate.

about the shading, you are using something similar to what i used in the early days, before figuring out how to do real 2d texture shading.. another way to do it is a simple multiply.. however that will kinda darken all of your image.. your algo looks like it could use some serious range checking though..since you just AND the final color.. overflows here we go :P still looking good..

one problem with coding texgens is that its so damn fun.. once you have started its real hard to just stop.. i could have had a finished product YEARS ago(my texgen was complete when ile released his) still i kept on adding stuff and modifying it.. cant.... resist... coding.... filters...
Challenge Trophies Won:

Rbz

Quoteand yeah, ekoli had a point there on the xor texture.. i still have it in my texture simply because it's basically the same as checkerboard and thus i have em in the same function, just passing a byte to decide which one to generate.
I love xor texture :) , that dude who invented it was a genius!

Quoteabout the shading, you are using something similar to what i used in the early days, before figuring out how to do real 2d texture shading.. another way to do it is a simple multiply.. however that will kinda darken all of your image.. your algo looks like it could use some serious range checking though..since you just AND the final color.. overflows here we go Tongue still looking good..
I got it working  :P, thanks for your help!

Quoteone problem with coding texgens is that its so damn fun.. once you have started its real hard to just stop.. i could have had a finished product YEARS ago(my texgen was complete when ile released his) still i kept on adding stuff and modifying it.. cant.... resist... coding.... filters...
Very true, working with texgen's make you addicted  ::)


New:
- Added "rotate" function, it just rotate a texture with your desired angle and zoom in/out, thanks Ekoli for the idea  :P
- Merged "edgeDetection" , "textureEmboss" and "textureBlur" into a function called "kernelFilter" capable to use 3x3 kernel filter as Ekoli has suggested, now I just pass to that function the filter config that I want (blur,emboss, edge detect, etc), much more simple to use.

:cheers:
Challenge Trophies Won:

Rbz

*bump*

I'm still working on this one, coded entirely in C + OGL, here a screen of my editor:

http://www.rbraz.com/temp/texEditor1.PNG

Soon, I will have an working version and will post an .exe here for you to test.
Challenge Trophies Won:

Shockwave

Voronoi! Looks really nice Rbraz! Looking forward to using the exe too!
Shockwave ^ Codigos
Challenge Trophies Won:

rdc

Looking good man. Can't wait to see it.

ferris

Can't believe I haven't posted here yet :P

I love watching texgen's be developed, I think it's the most fun part of creating 64k's ;D
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Clyde

Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Rbz

#17
Thanks dudes

Here the first preview:
[edited] I have found some nasty bugs with ogl memory, I'll add a new link soon...

All commands are very simple to use, the only thing that is not too clear is how to select "Destination" and "Source" texture, just click your left mouse button on the desired texture box to select "Destination" texture and use right mouse button to select "Sources", one click select first source, second click = second source.

Todo:
-Remove bugs, somewhere... :)
-Add "Undo" button
-Create better image buttons and menus
-Export texture creation sequence
-Save texture image
-More functions...
-...
Challenge Trophies Won:

Shockwave

It's looking very good Rbraz, I could use the generators, however I couldnt get the distortions to work, eg twirl, sines, etc.. I've never found gui programming to be something that personally interested me before, however that doesn't mean I don't find it interesting!

In the finished version, will it be possible so save out the textures? I wouldn't mind a tool like this.

Thanks :)
Shockwave ^ Codigos
Challenge Trophies Won:

Rbz

QuoteIt's looking very good Rbraz, I could use the generators, however I couldnt get the distortions to work, eg twirl, sines, etc..
I'll try to make it more simple to use, I guess the use of left/right buttons to select destination/source boxes isn't a good idea  :-\

QuoteIn the finished version, will it be possible so save out the textures? I wouldn't mind a tool like this.
Yes, I will add that feature, I just need to code the cracktro remake first :)
Challenge Trophies Won: