flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > Transparency once again...

Author
Thread Post new topic Reply to topic
macgub



Joined: 11 Jan 2006
Posts: 346
Location: Poland
macgub 19 Mar 2022, 19:24
Transaprency once again.
Sword part of object taken from svn server of KolibriOS. Heart I made many years ago on piece of paper. Joint of both, some optimiztion on sword, separate every chunk - in app win3ds. Front of 'heart' chunk has 'only' reflective component. I think I gives more reliable transparent look... I want perform some real time shadows - but not yet... Roses texture taken somewhere from net...
Its sse4 32 bit app.
edit:
I change 'sword' part of object to my own, unfortunatelly bit biger. I attach only sources.
edit2:
I add bump effect, bilinear filtered like texture...


Description: src
Download
Filename: mater_dolorosa.zip
Filesize: 81.69 KB
Downloaded: 420 Time(s)



Last edited by macgub on 01 Apr 2022, 17:23; edited 2 times in total
Post 19 Mar 2022, 19:24
View user's profile Send private message Visit poster's website Reply with quote
sylware



Joined: 23 Oct 2020
Posts: 437
Location: Marseille/France
sylware 20 Mar 2022, 12:04
isn't kolibriOS the hostile fork of menuetOS 32 which made the menuet authors go closed source for menuetOS 64?
Post 20 Mar 2022, 12:04
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 346
Location: Poland
macgub 20 Mar 2022, 13:09
Hi!
Thanks for your reply..
Quote:

isn't kolibriOS the hostile fork of menuetOS 32 which made the menuet authors go closed source for menuetOS 64?

I dont understand how this related to my example.. My app is open source, no depend to Menuet. If you ask about sword - if there is right conflict, I would make my own.. Just give a sign. Example is for Windows XP+ (I tested only win7, I don't have sse4 machine with XP), but making Kolibri/Menuet ports is not big problem.
Best regards.
Post 20 Mar 2022, 13:09
View user's profile Send private message Visit poster's website Reply with quote
FlierMate



Joined: 21 Jan 2021
Posts: 219
FlierMate 21 Mar 2022, 12:13
I test run it on Windows 10, the graphics look cool.

At first I thought Sword was a different length than Dword, Qword... but finally after seeing the graphics, only then I know it was the sharp object. Razz


Description:
Filesize: 176.62 KB
Viewed: 7125 Time(s)

transparency.png


Post 21 Mar 2022, 12:13
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4020
Location: vpcmpistri
bitRAKE 22 Mar 2022, 10:24
Starting with the fasmg distribution, I made the following changes to compile this fine example in fasmg:

First, delete folder "\mater_dolorosa2\include".

Extending the default 32-bit PE beyond Pentium 6:
\fasmg\packages\x86\include\format\format.inc, line 100
Code:
        format?.include '../cpu/x64.inc'    
Change include paths - beginning and end:
\mater_dolorosa2\mater_dolorosa.asm
Code:
include 'win32a.inc'
include 'cpu\ext\sse4.2.inc'    
Code:
section '.idata' import data readable writeable
    library kernel32,'KERNEL32',\
        user32,'USER32',\
        gdi32,'GDI32',\
\;        winmm,'WINMM',\; unused
        comdlg32,'COMDLG32'
    include 'api\kernel32.inc'
    include 'api\user32.inc'
    include 'api\gdi32.inc'
    include 'api\comdlg32.inc'    

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 22 Mar 2022, 10:24
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 346
Location: Poland
macgub 22 Mar 2022, 12:36
Thanks for your replies and work!! Very Happy
To be precise - I apply Phongs illumination model (ambient + diffuse * cos x + specular * cos^n x) as follows: Front of object has specular component, heart - only, sword - specular + diffuse + ambient; surfaces that are more deep, more far from observer have diffuse + ambient part of equation.
Post 22 Mar 2022, 12:36
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 346
Location: Poland
macgub 01 Apr 2022, 17:25
I add bump effect and renew attachment to first post..
Post 01 Apr 2022, 17:25
View user's profile Send private message Visit poster's website Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 716
Ali.Z 01 Apr 2022, 17:56
works well under WINE, perhaps your final transparency would be depth-independent transparency Cool

_________________
Asm For Wise Humans
Post 01 Apr 2022, 17:56
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 01 Apr 2022, 19:24
bitRAKE wrote:
Extending the default 32-bit PE beyond Pentium 6:
\fasmg\packages\x86\include\format\format.inc, line 100
Code:
        format?.include '../cpu/x64.inc'    
This is not really needed if you include SSE4, as it includes SSE2 as well - and for 32-bit code p6.inc+ext/sse2.inc provides more or less the same as including x64.inc.

And I had to do one more thing here, replace lines like:
Code:
tex_2:          times 4 dd 2.0    
with:
Code:
tex_2:          dd 4 dup 2.0    
Post 01 Apr 2022, 19:24
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4020
Location: vpcmpistri
bitRAKE 02 Apr 2022, 16:05
Tomasz Grysztar wrote:
p6.inc+ext/sse2.inc provides more or less the same as including x64.inc
Nice. I had an error once [can't even recall what it was] and imagined a cut-off in 32-bit support; but in hind-sight that doesn't make sense. Maybe, I've been thinking about it from an invalid perspective.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 02 Apr 2022, 16:05
View user's profile Send private message Visit poster's website Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 346
Location: Poland
macgub 02 Apr 2022, 16:28
Thanks all for replies !!
Ali.Z wrote:
works well under WINE, perhaps your final transparency would be depth-independent transparency Cool

Yes - its depth-independent transparency. I tried with kind of sorted transparency in other project. I sort every pixel by its z position and achive kind of G-buffer, but with only sorted Z coord. But in this example is depth independent.
BTW Morgan McGuire wrote some articles this topic related - to read on https://casual-effects.com
Post 02 Apr 2022, 16:28
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.