Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 20th Oct 2012 20:26
Hi all,

I made a model viewer sometime ago called ModelFX, im now working on a new version and wanted to add a feature similar to crazybump, where you can load a texture and it will automatically generate a normal map.

So far i have some sample code i found on here which works well, but doesnt give the results i want, its as though i need to remove some noise from the base texture and increase the depth, but i have no idea how to do this, i will include the image i want and the image im getting.

Any help with this will be greatly appreciated.

Attachments

Login to view attachments
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Oct 2012 00:47
It seems you want to get blured image ....what about blur bitmap and get image ?

Cheers.

I'm not a grumpy grandpa
The Weeping Corpse
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 21st Oct 2012 03:39
@GeneralFOL

Looks like you need some type of blur function, can you provide a link to the sample code you found because I will be interested in this at some point in the near future.



GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 21st Oct 2012 15:08
Hi guys,

Yes i need some way of blurring, but without blurring all the edges, its all a bit beyond me at the mo.

I cant remember where i found the code, but i will have a look and post back when i have.

The Weeping Corpse
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 21st Oct 2012 16:57 Edited at: 21st Oct 2012 17:16
GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 21st Oct 2012 18:14
Hi again, thanks for the links, its all a bit confusing, not sure how to start with creating a convmatrix and applying it to the image.

I cant find the code but i will include the zip i downloaded here for you anyway as an attatchment.

Thanks for the help.

Attachments

Login to view attachments
The Weeping Corpse
12
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 21st Oct 2012 20:08
Thanks for the zip. If I get time tomorrow night I will write a quick demo of how to apply a convolution matrix with a DBPro image.

Unless somebody else beats me to it.

GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 21st Oct 2012 20:08
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Oct 2012 23:25
Quote: "That would be awesome, thanks."

+1

Le Verdier
12
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 22nd Oct 2012 22:07 Edited at: 23rd Oct 2012 16:19
Here's a snippet for convolving a bitmap

example with a simple 3x3 box filter, but look at the Sobel edge detection kernals in the links above..




It's requires IanM's Matrix1DLLs

GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 23rd Oct 2012 16:21
Hi Le Verdier,

Thanks for the code, it is very much appreciated, however im having toruble getting it to run, seems i havnt got the Dll's installed correctly as it doesnt recognise the SetKernalRow commands.

Will keep trying tho, thanks again.

Le Verdier
12
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 23rd Oct 2012 16:28
I just use the enhanced RGB(a,r,g,b) function of the DLL

You can try:
Dot X, Y, RGB(TotalRed#*255, TotalGreen#*255, TotalBlue#*255)

if alpha is not required...

GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 23rd Oct 2012 18:22 Edited at: 23rd Oct 2012 18:53
Hi again,

I got it working now, it works brilliantly.

Thanks again.

To clarify, this is a blur matrix?.

Im messing with the code a bit now to see if i can remove more noise from a bitmap with it.

Any pointers for this appreciated.

Le Verdier
12
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 25th Oct 2012 13:25
Yes it's a blur kernal, there is larger kernals that produce stronger blur(gaussian..) but it's Not the point here, (blur bitmap command ils good enough). Try also to tweak the 'yunit = 0.05' with other values to adjust bump range..

GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 25th Oct 2012 16:48
Hi again, yeas increasing the 'yunit' greatly increases the bump range, it also increases the finer detail bump, which is the part im trying to remove.

Still experimentin with noise reduction, hopefully will crack it soon.

Login to post a reply

Server time is: 2024-04-26 12:36:52
Your offset time is: 2024-04-26 12:36:52