Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (NnamueN, Akow, 1 invisible), 1,421 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | chip programmers | 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