• About us
  • Contact Us
  • Terms and Conditions
  • Forum
  • Materials
  • Shaders
  • Tools
  • Video
  • Learn
  • Gallery
My Mental Ray
Go Back   MyMentalray Forum > mental ray Standalone > Shader Writing
Reload this Page mental ray noise functions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes

Old 12-22-2008, 07:43 PM   #1
aanton
Hobbyist
 
Join Date: Nov 2008
Posts: 3
Default mental ray noise functions

Hi there,

I need to use the mental ray noise functions for an animated geometry shader, however, each time the shader is called, a different noise function is generated. I tried to seed the random numbers generator with a certain value, but it makes no difference. I've tried all possible noise functions:
mi_noise_1d
mi_noise_2d
mi_noise_3d
and also the uniform noise functions. All functions look different each time the shader is run.
Is this a bug or is there some way to "lock" the noise function, so it is the same, each call.

Here is the code I am using:

Code:
#include <stdio.h>
#include <stdlib.h>
#include <shader.h>

DLLEXPORT int mynoise_version(void) { return(1); }
DLLEXPORT miBoolean mynoise(
	miTag		*result,
	miState		*state,
	test_t		*paras)
{
	int z;

	for (z = 0; z < 100; z++)	
		printf("noise(%i): %f",z,mi_noise_1d(z));


	return miTRUE;

}
The output will be different each time the scene is rendered.

Thank you very much in advance,
Anton

Last edited by aanton : 12-22-2008 at 07:58 PM.
aanton is offline   Reply With Quote
aanton
View Public Profile
Send a private message to aanton
Find More Posts by aanton

Old 01-01-2009, 09:08 AM   #2
haggi
Hobbyist
 
Join Date: Jan 2007
Posts: 11
Default

Thats really strange.
I just tried the same with exactly the same result every time the shader is called. The only difference I can see it that I dont use a printf but a mi_info(). Even with your print function, it is exactly the same every time.
haggi is offline   Reply With Quote
haggi
View Public Profile
Send a private message to haggi
Find More Posts by haggi

Old 01-01-2009, 04:10 PM   #3
aanton
Hobbyist
 
Join Date: Nov 2008
Posts: 3
Default

Hmm... what mental ray version are you using? I tried the two latest ones, same problem.
aanton is offline   Reply With Quote
aanton
View Public Profile
Send a private message to aanton
Find More Posts by aanton

Old 01-02-2009, 03:15 PM   #4
haggi
Hobbyist
 
Join Date: Jan 2007
Posts: 11
Default

I only tried the mr version in maya2008 what means mentalray 3.6
haggi is offline   Reply With Quote
haggi
View Public Profile
Send a private message to haggi
Find More Posts by haggi

Old 01-04-2009, 02:23 PM   #5
aanton
Hobbyist
 
Join Date: Nov 2008
Posts: 3
Default 3.6 ok, 3.7 buggy

Hi,

indeed you are right! I tried mental ray version 3.6, works fine! With the 3.7 version the noise function produces a different result each time.
Thanks!

Last edited by aanton : 01-04-2009 at 05:36 PM.
aanton is offline   Reply With Quote
aanton
View Public Profile
Send a private message to aanton
Find More Posts by aanton

Old 01-05-2009, 03:58 PM   #6
haggi
Hobbyist
 
Join Date: Jan 2007
Posts: 11
Default

I just tried it with mr 3.7 and maya2009: Every call gives back exactly the same result, every time.
haggi is offline   Reply With Quote
haggi
View Public Profile
Send a private message to haggi
Find More Posts by haggi

Old 01-07-2009, 05:14 AM   #7
MasterZap
Junior Artist
 
Join Date: Nov 2006
Location: Eskilstuna, Sweden
Posts: 318
Default

This shouldn't be. But mi_noies_1d wants a float, not an integer.... dunno if that matters... but for a given input, yes, the noise functions should retun a given output, no change.

/Z
__________________
zap andersson - mental images shader geek - mentalraytips.blogspot.com
MasterZap is offline   Reply With Quote
MasterZap
View Public Profile
Send a private message to MasterZap
Visit MasterZap's homepage!
Find More Posts by MasterZap

Old 03-07-2009, 07:21 AM   #8
nopq285
Hobbyist
 
Join Date: Feb 2009
Posts: 1
Arrow why almost all women have many handbags

Handbags have been a good accessory in completing women's outfit. There are a wide variety of handbags that come in different styles, designs, materials, colors and sizes. These accessories have great significance because of their versatility features. Both men and women carry bags, however, it is just well-known that women use them more than men. Furthermore, handbags are also use to create a fashion statement. Different designs and styles are born each year. Celebrities and popular TV icons are often the first to try trendy handbags to complete their looks.Different variety of handbags were basically designed for different purposes. And to make it widely available to everyone, such fashion accessories are now available in different variety of designs, styles and colors to incorporate with different wardrobes. This is the reason why almost all women have 3-5 different types of handbags in their closet
nopq285 is offline   Reply With Quote
nopq285
View Public Profile
Send a private message to nopq285
Find More Posts by nopq285

Old 10-30-2009, 12:18 PM   #9
plurbKar73
Hobbyist
 
plurbKar73's Avatar
 
Join Date: Oct 2009
Location: United States
Posts: 9
Send a message via ICQ to plurbKar73
Default mental ray noise functions

You are certainly right. In it something is and it is excellent thought. I support you.
plurbKar73 is offline   Reply With Quote
plurbKar73
View Public Profile
Send a private message to plurbKar73
Visit plurbKar73's homepage!
Find More Posts by plurbKar73
Reply

« Previous Thread | Next Thread »

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode
Hybrid Mode Switch to Hybrid Mode
Threaded Mode Switch to Threaded Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 04:41 AM.

Contact Us - Welcome to MyMentalRay Forum - Archive - Top
Copyright © 2008 My Mental Ray Community. All Rights Reserved.
No part of this website may be reproduced unless for personal use without prior written permission from The My Mental Ray Community.