Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, TipmyPip, OptimusPrime), 15,359 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help translating a shader from OpenGL to A6 #109192
01/25/07 18:41
01/25/07 18:41
Joined: Apr 2002
Posts: 117
Spain
Abstracto Offline OP
Member
Abstracto  Offline OP
Member

Joined: Apr 2002
Posts: 117
Spain
Hi,

I have seen a nice shader code, that makes the render to look
like a pencil drawing, but i dont understand it.
I got the OpenGL code for it on an article in Programings Gems 4.
its like this,
Code:
  
//stage 0: smooth threshold function 4*((1-L)-H)

glActiveTexture( GL_TEXTURE0 );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_SUBTRACT );
glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS );
glTexEnvi( GL_TEXTURE_ENV, GL_SOURCE1_RGB, GL_TEXTURE );
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_ONE_MINUS_SRC_COLOR );
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
glTexEnvi(GL_TEXTURE_ENV,

//stage 1: invert function (1-previous)
glActiveTexture( GL_TEXTURE1 );
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE );
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PREVIOUS );
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_ONE_MINUS_SRC_COLOR );



can anyone help me to convert it to A6 and explain me it a bit?
THANKS!!!!

im not sure its a shader or there is some other way
(as multitexture operations)to make this effect.

Last edited by Abstracto; 01/25/07 19:57.
Re: Help translating a shader from OpenGL to A6 [Re: Abstracto] #109193
01/25/07 19:00
01/25/07 19:00
Joined: Jul 2004
Posts: 1,924
Finland
Ambassador Offline
Serious User
Ambassador  Offline
Serious User

Joined: Jul 2004
Posts: 1,924
Finland
That's not a shader, rather just normal OpenGL code. Though you can probably achieve the thing that code does with a shader too... I'm not familiar with HLSL (which A6 uses), just with GLSL so probably won't be able to help you...

Re: Help translating a shader from OpenGL to A6 [Re: Ambassador] #109194
01/26/07 01:49
01/26/07 01:49
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
There is a sketch shader on the wiki if I'm not mistaken.

If there isn't, let me know and I can take a lil' look for it under some of the other users i know. Or, you can do a search on the forums for it, but I know it's somewhere...


xXxGuitar511
- Programmer
Re: Help translating a shader from OpenGL to A6 [Re: Abstracto] #109195
01/26/07 06:38
01/26/07 06:38
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Yes this is not a shader but Opengl code using register combiners i beleive... i'm not very familiar with OGL but you might be able to map this to D3D Fixed-Function commands.

However, for such effects you are normally encouraged to use pixel shaders...


Sphere Engine--the premier A6 graphics plugin.

Moderated by  Blink, Hummel, Superku 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1